From bdfdc67563322cf80ecaf8ab90fd7ff1f562421c Mon Sep 17 00:00:00 2001 From: Nikita Kuznetsov Date: Mon, 18 Mar 2024 16:25:57 +0100 Subject: [PATCH 01/10] Migrate to ton core --- apps/desktop/webpack.renderer.config.ts | 8 +- apps/extension/config-overrides.js | 6 +- apps/extension/package.json | 3 - apps/web/vite.config.mts | 8 +- packages/core/package.json | 6 +- .../src/entries/crypto/asset/basic-asset.ts | 2 +- .../src/entries/crypto/asset/ton-asset.ts | 2 +- packages/core/src/service/mnemonicService.ts | 2 +- packages/core/src/service/proService.ts | 22 ++-- .../src/service/tonConnect/connectService.ts | 6 +- packages/core/src/service/transfer/common.ts | 12 +- .../src/service/transfer/jettonService.ts | 4 +- .../core/src/service/transfer/nftService.ts | 4 +- .../core/src/service/transfer/tonService.ts | 6 +- packages/core/src/service/tron/tronService.ts | 2 +- .../src/service/wallet/contractService.ts | 8 +- .../core/src/service/wallet/storeService.ts | 2 +- packages/core/src/service/walletService.ts | 6 +- packages/core/src/utils/AmountFormatter.ts | 2 +- packages/core/src/utils/common.ts | 2 +- packages/uikit/package.json | 6 +- .../activity/ton/JettonNotifications.tsx | 4 +- .../uikit/src/components/create/Words.tsx | 4 +- .../components/home/BuyItemNotification.tsx | 2 +- .../uikit/src/components/home/Jettons.tsx | 2 +- packages/uikit/src/components/nft/LinkNft.tsx | 2 +- .../uikit/src/components/nft/NftAction.tsx | 4 +- .../uikit/src/components/nft/NftDetails.tsx | 2 +- .../components/transfer/ConfirmListItem.tsx | 4 +- .../hooks/blockchain/useEstimateTransfer.ts | 2 +- .../src/hooks/blockchain/useSendTransfer.ts | 2 +- packages/uikit/src/pages/coin/Jetton.tsx | 2 +- packages/uikit/src/pages/import/Create.tsx | 4 +- packages/uikit/src/pages/import/Password.tsx | 4 +- packages/uikit/src/state/asset.ts | 2 +- .../src/state/dashboard/useDashboardData.ts | 12 +- packages/uikit/src/state/mnemonic.ts | 2 +- packages/uikit/src/state/wallet.ts | 16 +-- yarn.lock | 109 +++++++++--------- 39 files changed, 152 insertions(+), 146 deletions(-) diff --git a/apps/desktop/webpack.renderer.config.ts b/apps/desktop/webpack.renderer.config.ts index 67d238645..e565f1108 100644 --- a/apps/desktop/webpack.renderer.config.ts +++ b/apps/desktop/webpack.renderer.config.ts @@ -22,7 +22,13 @@ export const rendererConfig: Configuration = { 'react-router-dom': path.resolve(__dirname, './node_modules/react-router-dom'), 'styled-components': path.resolve(__dirname, './node_modules/styled-components'), 'react-i18next': path.resolve(__dirname, './node_modules/react-i18next'), - '@tanstack/react-query': path.resolve(__dirname, './node_modules/@tanstack/react-query') + '@tanstack/react-query': path.resolve( + __dirname, + './node_modules/@tanstack/react-query' + ), + '@ton/core': path.resolve(__dirname, '../../packages/core/node_modules/@ton/core'), + '@ton/crypto': path.resolve(__dirname, '../../packages/core/node_modules/@ton/crypto'), + '@ton/ton': path.resolve(__dirname, '../../packages/core/node_modules/@ton/ton') } } }; diff --git a/apps/extension/config-overrides.js b/apps/extension/config-overrides.js index b6620ca2d..5ec9ff86c 100644 --- a/apps/extension/config-overrides.js +++ b/apps/extension/config-overrides.js @@ -15,9 +15,9 @@ module.exports = function override(config, env) { config.resolve.alias = { ...config.resolve.alias, react: path.resolve(__dirname, './node_modules/react'), - ton: path.resolve(__dirname, './node_modules/ton'), - 'ton-core': path.resolve(__dirname, './node_modules/ton-core'), - 'ton-crypto': path.resolve(__dirname, './node_modules/ton-crypto'), + '@ton/core': path.resolve(__dirname, '../../packages/core/node_modules/@ton/core'), + '@ton/crypto': path.resolve(__dirname, '../../packages/core/node_modules/@ton/crypto'), + '@ton/ton': path.resolve(__dirname, '../../packages/core/node_modules/@ton/ton'), 'react-dom': path.resolve(__dirname, './node_modules/react-dom'), 'react-router-dom': path.resolve(__dirname, './node_modules/react-router-dom'), 'styled-components': path.resolve(__dirname, './node_modules/styled-components'), diff --git a/apps/extension/package.json b/apps/extension/package.json index 410eb8a9e..f3a1ea987 100644 --- a/apps/extension/package.json +++ b/apps/extension/package.json @@ -19,9 +19,6 @@ "react-router-dom": "^6.4.5", "stream-browserify": "^3.0.0", "styled-components": "^6.1.1", - "ton": "^13.4.1", - "ton-core": "^0.49.0", - "ton-crypto": "^3.2.0", "uuid": "^9.0.1", "web-vitals": "^2.1.4", "webextension-polyfill": "^0.10.0" diff --git a/apps/web/vite.config.mts b/apps/web/vite.config.mts index 2c4348fc5..774a8e954 100644 --- a/apps/web/vite.config.mts +++ b/apps/web/vite.config.mts @@ -11,7 +11,13 @@ export default defineConfig({ 'react-router-dom': path.resolve(__dirname, './node_modules/react-router-dom'), 'styled-components': path.resolve(__dirname, './node_modules/styled-components'), 'react-i18next': path.resolve(__dirname, './node_modules/react-i18next'), - '@tanstack/react-query': path.resolve(__dirname, './node_modules/@tanstack/react-query') + '@tanstack/react-query': path.resolve( + __dirname, + './node_modules/@tanstack/react-query' + ), + '@ton/core': path.resolve(__dirname, '../../packages/core/node_modules/@ton/core'), + '@ton/crypto': path.resolve(__dirname, '../../packages/core/node_modules/@ton/crypto'), + '@ton/ton': path.resolve(__dirname, '../../packages/core/node_modules/@ton/ton') } } }); diff --git a/packages/core/package.json b/packages/core/package.json index 58721d7ba..36156364b 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -19,12 +19,12 @@ "yarn-run-all": "^3.1.1" }, "dependencies": { + "@ton/core": "0.54.0", + "@ton/crypto": "3.2.0", + "@ton/ton": "https://github.com/tonkeeper/tonkeeper-ton#build4", "bignumber.js": "^9.1.1", "ethers": "^6.6.5", "query-string": "^8.1.0", - "ton": "^13.4.1", - "ton-core": "^0.49.0", - "ton-crypto": "^3.2.0", "tweetnacl": "^1.0.3" } } diff --git a/packages/core/src/entries/crypto/asset/basic-asset.ts b/packages/core/src/entries/crypto/asset/basic-asset.ts index 8035d97bc..40c39bfc8 100644 --- a/packages/core/src/entries/crypto/asset/basic-asset.ts +++ b/packages/core/src/entries/crypto/asset/basic-asset.ts @@ -1,4 +1,4 @@ -import { Address } from 'ton-core'; +import { Address } from '@ton/core'; import { BLOCKCHAIN_NAME } from '../../crypto'; export interface BasicAsset { diff --git a/packages/core/src/entries/crypto/asset/ton-asset.ts b/packages/core/src/entries/crypto/asset/ton-asset.ts index c89037725..13aee7384 100644 --- a/packages/core/src/entries/crypto/asset/ton-asset.ts +++ b/packages/core/src/entries/crypto/asset/ton-asset.ts @@ -1,4 +1,4 @@ -import { Address } from 'ton-core'; +import { Address } from '@ton/core'; import { JettonsBalances } from '../../../tonApiV2'; import { BLOCKCHAIN_NAME } from '../../crypto'; import { BasicAsset, packAssetId } from './basic-asset'; diff --git a/packages/core/src/service/mnemonicService.ts b/packages/core/src/service/mnemonicService.ts index 09e88da5d..161f6dd77 100644 --- a/packages/core/src/service/mnemonicService.ts +++ b/packages/core/src/service/mnemonicService.ts @@ -1,4 +1,4 @@ -import { mnemonicValidate } from 'ton-crypto'; +import { mnemonicValidate } from '@ton/crypto'; import { AppKey } from '../Keys'; import { IStorage } from '../Storage'; import { decrypt } from './cryptoService'; diff --git a/packages/core/src/service/proService.ts b/packages/core/src/service/proService.ts index 059063f21..407588855 100644 --- a/packages/core/src/service/proService.ts +++ b/packages/core/src/service/proService.ts @@ -1,36 +1,36 @@ +import { Address } from '@ton/core'; import BigNumber from 'bignumber.js'; -import { Address } from 'ton-core'; import { AppKey } from '../Keys'; import { IStorage } from '../Storage'; import { APIConfig } from '../entries/apis'; import { BLOCKCHAIN_NAME } from '../entries/crypto'; import { AssetAmount } from '../entries/crypto/asset/asset-amount'; import { TON_ASSET } from '../entries/crypto/asset/constants'; +import { DashboardCell, DashboardColumn } from '../entries/dashboard'; +import { FiatCurrencies } from '../entries/fiat'; import { Language, localizationText } from '../entries/language'; import { ProState, ProSubscription, ProSubscriptionInvalid } from '../entries/pro'; import { RecipientData, TonRecipientData } from '../entries/send'; import { WalletState } from '../entries/wallet'; import { AccountsApi } from '../tonApiV2'; import { - InvoicesInvoice, + FiatCurrencies as FiatCurrenciesGenerated, InvoiceStatus, + InvoicesInvoice, Lang, - ProServiceService, - FiatCurrencies as FiatCurrenciesGenerated, - ProServiceDashboardColumnType, - ProServiceDashboardCellString, ProServiceDashboardCellAddress, ProServiceDashboardCellNumericCrypto, - ProServiceDashboardCellNumericFiat + ProServiceDashboardCellNumericFiat, + ProServiceDashboardCellString, + ProServiceDashboardColumnType, + ProServiceService } from '../tonConsoleApi'; import { delay } from '../utils/common'; +import { Flatten } from '../utils/types'; +import { loginViaTG } from './telegramOauth'; import { createTonProofItem, tonConnectProofPayload } from './tonConnect/connectService'; import { walletStateInitFromState } from './wallet/contractService'; import { getWalletState } from './wallet/storeService'; -import { loginViaTG } from './telegramOauth'; -import { DashboardCell, DashboardColumn } from '../entries/dashboard'; -import { FiatCurrencies } from '../entries/fiat'; -import { Flatten } from '../utils/types'; export const setBackupState = async (storage: IStorage, state: ProSubscription) => { await storage.set(AppKey.PRO_BACKUP, state); diff --git a/packages/core/src/service/tonConnect/connectService.ts b/packages/core/src/service/tonConnect/connectService.ts index d2a1d340c..b331c9af2 100644 --- a/packages/core/src/service/tonConnect/connectService.ts +++ b/packages/core/src/service/tonConnect/connectService.ts @@ -1,11 +1,11 @@ -import queryString from 'query-string'; -import { Address, beginCell, storeStateInit } from 'ton-core'; +import { Address, beginCell, storeStateInit } from '@ton/core'; import { getSecureRandomBytes, keyPairFromSeed, mnemonicToPrivateKey, sha256_sync -} from 'ton-crypto'; +} from '@ton/crypto'; +import queryString from 'query-string'; import nacl from 'tweetnacl'; import { IStorage } from '../../Storage'; import { TonConnectError } from '../../entries/exception'; diff --git a/packages/core/src/service/transfer/common.ts b/packages/core/src/service/transfer/common.ts index d26c7542a..3bb64df63 100644 --- a/packages/core/src/service/transfer/common.ts +++ b/packages/core/src/service/transfer/common.ts @@ -1,4 +1,3 @@ -import BigNumber from 'bignumber.js'; import { Address, beginCell, @@ -8,11 +7,12 @@ import { internal, storeMessage, toNano -} from 'ton-core'; -import { mnemonicToPrivateKey } from 'ton-crypto'; -import { WalletContractV3R1 } from 'ton/dist/wallets/WalletContractV3R1'; -import { WalletContractV3R2 } from 'ton/dist/wallets/WalletContractV3R2'; -import { WalletContractV4 } from 'ton/dist/wallets/WalletContractV4'; +} from '@ton/core'; +import { mnemonicToPrivateKey } from '@ton/crypto'; +import { WalletContractV3R1 } from '@ton/ton/dist/wallets/WalletContractV3R1'; +import { WalletContractV3R2 } from '@ton/ton/dist/wallets/WalletContractV3R2'; +import { WalletContractV4 } from '@ton/ton/dist/wallets/WalletContractV4'; +import BigNumber from 'bignumber.js'; import nacl from 'tweetnacl'; import { APIConfig } from '../../entries/apis'; import { WalletState } from '../../entries/wallet'; diff --git a/packages/core/src/service/transfer/jettonService.ts b/packages/core/src/service/transfer/jettonService.ts index 17a4602d8..4c8014e21 100644 --- a/packages/core/src/service/transfer/jettonService.ts +++ b/packages/core/src/service/transfer/jettonService.ts @@ -1,6 +1,6 @@ +import { Address, beginCell, Cell, comment, internal, toNano } from '@ton/core'; +import { mnemonicToPrivateKey } from '@ton/crypto'; import BigNumber from 'bignumber.js'; -import { Address, beginCell, Cell, comment, internal, toNano } from 'ton-core'; -import { mnemonicToPrivateKey } from 'ton-crypto'; import { APIConfig } from '../../entries/apis'; import { AssetAmount } from '../../entries/crypto/asset/asset-amount'; import { TonAsset } from '../../entries/crypto/asset/ton-asset'; diff --git a/packages/core/src/service/transfer/nftService.ts b/packages/core/src/service/transfer/nftService.ts index 3d76e8588..957f367a9 100644 --- a/packages/core/src/service/transfer/nftService.ts +++ b/packages/core/src/service/transfer/nftService.ts @@ -1,6 +1,6 @@ +import { Address, beginCell, Cell, comment, toNano } from '@ton/core'; +import { mnemonicToPrivateKey } from '@ton/crypto'; import BigNumber from 'bignumber.js'; -import { Address, beginCell, Cell, comment, toNano } from 'ton-core'; -import { mnemonicToPrivateKey } from 'ton-crypto'; import { APIConfig } from '../../entries/apis'; import { TonRecipientData } from '../../entries/send'; import { WalletState } from '../../entries/wallet'; diff --git a/packages/core/src/service/transfer/tonService.ts b/packages/core/src/service/transfer/tonService.ts index 55607bb75..908ecade9 100644 --- a/packages/core/src/service/transfer/tonService.ts +++ b/packages/core/src/service/transfer/tonService.ts @@ -1,7 +1,7 @@ +import { Address, Cell, internal, loadStateInit } from '@ton/core'; +import { Maybe } from '@ton/core/dist/utils/maybe'; +import { mnemonicToPrivateKey } from '@ton/crypto'; import BigNumber from 'bignumber.js'; -import { Address, Cell, internal, loadStateInit } from 'ton-core'; -import { Maybe } from 'ton-core/dist/utils/maybe'; -import { mnemonicToPrivateKey } from 'ton-crypto'; import { APIConfig } from '../../entries/apis'; import { AssetAmount } from '../../entries/crypto/asset/asset-amount'; import { TonRecipient, TonRecipientData } from '../../entries/send'; diff --git a/packages/core/src/service/tron/tronService.ts b/packages/core/src/service/tron/tronService.ts index aa24fd269..451775d1f 100644 --- a/packages/core/src/service/tron/tronService.ts +++ b/packages/core/src/service/tron/tronService.ts @@ -1,5 +1,5 @@ +import { hmac_sha512, mnemonicToPrivateKey } from '@ton/crypto'; import { ethers } from 'ethers'; -import { hmac_sha512, mnemonicToPrivateKey } from 'ton-crypto'; import { IStorage } from '../../Storage'; import { Network } from '../../entries/network'; import { Factories, TronChain, WalletImplementations } from '../../entries/tron'; diff --git a/packages/core/src/service/wallet/contractService.ts b/packages/core/src/service/wallet/contractService.ts index 9b9142ba8..7864b4946 100644 --- a/packages/core/src/service/wallet/contractService.ts +++ b/packages/core/src/service/wallet/contractService.ts @@ -1,7 +1,7 @@ -import { beginCell, storeStateInit } from 'ton-core'; -import { WalletContractV3R1 } from 'ton/dist/wallets/WalletContractV3R1'; -import { WalletContractV3R2 } from 'ton/dist/wallets/WalletContractV3R2'; -import { WalletContractV4 } from 'ton/dist/wallets/WalletContractV4'; +import { beginCell, storeStateInit } from '@ton/core'; +import { WalletContractV3R1 } from '@ton/ton/dist/wallets/WalletContractV3R1'; +import { WalletContractV3R2 } from '@ton/ton/dist/wallets/WalletContractV3R2'; +import { WalletContractV4 } from '@ton/ton/dist/wallets/WalletContractV4'; import { WalletState, WalletVersion } from '../../entries/wallet'; export const walletContractFromState = (wallet: WalletState) => { diff --git a/packages/core/src/service/wallet/storeService.ts b/packages/core/src/service/wallet/storeService.ts index e70cefdfe..5cef1a3bb 100644 --- a/packages/core/src/service/wallet/storeService.ts +++ b/packages/core/src/service/wallet/storeService.ts @@ -1,4 +1,4 @@ -import { Address } from 'ton-core'; +import { Address } from '@ton/core'; import { AppKey } from '../../Keys'; import { IStorage } from '../../Storage'; import { AccountState } from '../../entries/account'; diff --git a/packages/core/src/service/walletService.ts b/packages/core/src/service/walletService.ts index a6735aaaa..cba6cc3bd 100644 --- a/packages/core/src/service/walletService.ts +++ b/packages/core/src/service/walletService.ts @@ -1,6 +1,6 @@ -import { Address } from 'ton-core'; -import { KeyPair, mnemonicToPrivateKey } from 'ton-crypto'; -import { WalletContractV4 } from 'ton/dist/wallets/WalletContractV4'; +import { Address } from '@ton/core'; +import { KeyPair, mnemonicToPrivateKey } from '@ton/crypto'; +import { WalletContractV4 } from '@ton/ton/dist/wallets/WalletContractV4'; import { IStorage } from '../Storage'; import { APIConfig } from '../entries/apis'; import { Network } from '../entries/network'; diff --git a/packages/core/src/utils/AmountFormatter.ts b/packages/core/src/utils/AmountFormatter.ts index 2e695585a..b18cde7c1 100644 --- a/packages/core/src/utils/AmountFormatter.ts +++ b/packages/core/src/utils/AmountFormatter.ts @@ -1,5 +1,5 @@ +import { fromNano } from '@ton/core'; import BigNumber from 'bignumber.js'; -import { fromNano } from 'ton-core'; import { FiatCurrency, FiatCurrencySymbolsConfig } from '../entries/fiat'; type LocaleFormat = { diff --git a/packages/core/src/utils/common.ts b/packages/core/src/utils/common.ts index bdd708cd1..ccd1c9542 100644 --- a/packages/core/src/utils/common.ts +++ b/packages/core/src/utils/common.ts @@ -1,5 +1,5 @@ +import { Address } from '@ton/core'; import { decodeBase58, sha256 } from 'ethers'; -import { Address } from 'ton-core'; import { Network } from '../entries/network'; export const delay = (ms: number) => new Promise(resolve => setTimeout(resolve, ms)); diff --git a/packages/uikit/package.json b/packages/uikit/package.json index 88c653f5a..16b73ba24 100644 --- a/packages/uikit/package.json +++ b/packages/uikit/package.json @@ -34,9 +34,6 @@ "react-transition-group": "^4.4.5", "slick-carousel": "^1.8.1", "styled-components": "^6.1.1", - "ton": "^13.4.1", - "ton-core": "^0.49.0", - "ton-crypto": "^3.2.0", "uuid": "^9.0.0" }, "devDependencies": { @@ -49,6 +46,8 @@ "@storybook/manager-webpack4": "^6.5.14", "@storybook/react": "^6.5.14", "@storybook/testing-library": "^0.0.13", + "@ton/core": "0.54.0", + "@ton/crypto": "3.2.0", "@types/country-list-js": "^3.1.3", "@types/react": "^18.0.26", "@types/react-beautiful-dnd": "^13.1.3", @@ -63,6 +62,7 @@ "react-is": "^18.2.0", "require-from-string": "^2.0.2", "storybook-addon-turbo-build": "^1.1.0", + "tweetnacl": "^1.0.3", "typescript": "^4.9.4", "webpack": "^5.88.2" } diff --git a/packages/uikit/src/components/activity/ton/JettonNotifications.tsx b/packages/uikit/src/components/activity/ton/JettonNotifications.tsx index 100656fc2..123bd8827 100644 --- a/packages/uikit/src/components/activity/ton/JettonNotifications.tsx +++ b/packages/uikit/src/components/activity/ton/JettonNotifications.tsx @@ -1,3 +1,4 @@ +import { Address } from '@ton/core'; import { CryptoCurrency } from '@tonkeeper/core/dist/entries/crypto'; import { AccountEvent, @@ -8,8 +9,7 @@ import { JettonTransferAction } from '@tonkeeper/core/dist/tonApiV2'; import { formatDecimals } from '@tonkeeper/core/dist/utils/balance'; -import React, { FC, useMemo } from 'react'; -import { Address } from 'ton-core'; +import { FC, useMemo } from 'react'; import { useWalletContext } from '../../../hooks/appContext'; import { useFormatCoinValue } from '../../../hooks/balance'; import { useTranslation } from '../../../hooks/translation'; diff --git a/packages/uikit/src/components/create/Words.tsx b/packages/uikit/src/components/create/Words.tsx index e074aa607..806dad9f3 100644 --- a/packages/uikit/src/components/create/Words.tsx +++ b/packages/uikit/src/components/create/Words.tsx @@ -1,8 +1,8 @@ +import { mnemonicValidate } from '@ton/crypto'; +import { wordlist } from '@ton/crypto/dist/mnemonic/wordlist'; import React, { FC, useCallback, useEffect, useMemo, useRef, useState } from 'react'; import { useNavigate } from 'react-router-dom'; import styled, { css } from 'styled-components'; -import { mnemonicValidate } from 'ton-crypto'; -import { wordlist } from 'ton-crypto/dist/mnemonic/wordlist'; import { useAppContext } from '../../hooks/appContext'; import { useAppSdk } from '../../hooks/appSdk'; import { openIosKeyboard } from '../../hooks/ios'; diff --git a/packages/uikit/src/components/home/BuyItemNotification.tsx b/packages/uikit/src/components/home/BuyItemNotification.tsx index 7257d9d75..4e21ee0bb 100644 --- a/packages/uikit/src/components/home/BuyItemNotification.tsx +++ b/packages/uikit/src/components/home/BuyItemNotification.tsx @@ -1,4 +1,5 @@ import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query'; +import { sha512_sync } from '@ton/crypto'; import { FiatCurrencies } from '@tonkeeper/core/dist/entries/fiat'; import { WalletState } from '@tonkeeper/core/dist/entries/wallet'; import { @@ -9,7 +10,6 @@ import { import { formatAddress } from '@tonkeeper/core/dist/utils/common'; import React, { FC, useState } from 'react'; import styled, { css } from 'styled-components'; -import { sha512_sync } from 'ton-crypto'; import { v4 as uuidv4 } from 'uuid'; import { useBuyAnalytics } from '../../hooks/amplitude'; import { useAppContext, useWalletContext } from '../../hooks/appContext'; diff --git a/packages/uikit/src/components/home/Jettons.tsx b/packages/uikit/src/components/home/Jettons.tsx index 0b0dfe1fb..9f30b746f 100644 --- a/packages/uikit/src/components/home/Jettons.tsx +++ b/packages/uikit/src/components/home/Jettons.tsx @@ -1,10 +1,10 @@ +import { Address } from '@ton/core'; import { CryptoCurrency } from '@tonkeeper/core/dist/entries/crypto'; import { Account, JettonBalance, JettonsBalances } from '@tonkeeper/core/dist/tonApiV2'; import { TronBalances } from '@tonkeeper/core/dist/tronApi'; import { formatDecimals } from '@tonkeeper/core/dist/utils/balance'; import { FC, useMemo } from 'react'; import { useNavigate } from 'react-router-dom'; -import { Address } from 'ton-core'; import { useFormatBalance } from '../../hooks/balance'; import { useTranslation } from '../../hooks/translation'; import { AppRoute } from '../../libs/routes'; diff --git a/packages/uikit/src/components/nft/LinkNft.tsx b/packages/uikit/src/components/nft/LinkNft.tsx index e7f792757..dd2c287c9 100644 --- a/packages/uikit/src/components/nft/LinkNft.tsx +++ b/packages/uikit/src/components/nft/LinkNft.tsx @@ -1,3 +1,4 @@ +import { Address } from '@ton/core'; import { AssetAmount } from '@tonkeeper/core/dist/entries/crypto/asset/asset-amount'; import { TON_ASSET } from '@tonkeeper/core/dist/entries/crypto/asset/constants'; import { NFTDNS } from '@tonkeeper/core/dist/entries/nft'; @@ -10,7 +11,6 @@ import { isTMEDomain } from '@tonkeeper/core/dist/utils/nft'; import BigNumber from 'bignumber.js'; import React, { FC, useCallback, useEffect, useMemo, useState } from 'react'; import styled from 'styled-components'; -import { Address } from 'ton-core'; import { useWalletContext } from '../../hooks/appContext'; import { useToast } from '../../hooks/appSdk'; import { useAreNftActionsDisabled } from '../../hooks/blockchain/nft/useAreNftActionsDisabled'; diff --git a/packages/uikit/src/components/nft/NftAction.tsx b/packages/uikit/src/components/nft/NftAction.tsx index e18e90758..eafb5be10 100644 --- a/packages/uikit/src/components/nft/NftAction.tsx +++ b/packages/uikit/src/components/nft/NftAction.tsx @@ -1,8 +1,8 @@ +import { Address } from '@ton/core'; import { NFT, isNFTDNS } from '@tonkeeper/core/dist/entries/nft'; import { NftItem } from '@tonkeeper/core/dist/tonApiV2'; -import React, { FC, useState } from 'react'; +import { FC } from 'react'; import styled from 'styled-components'; -import { Address } from 'ton-core'; import { useWalletContext } from '../../hooks/appContext'; import { useAppSdk } from '../../hooks/appSdk'; import { useTranslation } from '../../hooks/translation'; diff --git a/packages/uikit/src/components/nft/NftDetails.tsx b/packages/uikit/src/components/nft/NftDetails.tsx index 29fa9f7e1..12f6a3526 100644 --- a/packages/uikit/src/components/nft/NftDetails.tsx +++ b/packages/uikit/src/components/nft/NftDetails.tsx @@ -1,8 +1,8 @@ +import { Address } from '@ton/core'; import { NftItem } from '@tonkeeper/core/dist/tonApiV2'; import { formatAddress, toShortValue } from '@tonkeeper/core/dist/utils/common'; import React, { FC } from 'react'; import styled from 'styled-components'; -import { Address } from 'ton-core'; import { useAppContext, useWalletContext } from '../../hooks/appContext'; import { useAppSdk } from '../../hooks/appSdk'; import { useDateFormat } from '../../hooks/dateFormat'; diff --git a/packages/uikit/src/components/transfer/ConfirmListItem.tsx b/packages/uikit/src/components/transfer/ConfirmListItem.tsx index fc12be9f8..44879924d 100644 --- a/packages/uikit/src/components/transfer/ConfirmListItem.tsx +++ b/packages/uikit/src/components/transfer/ConfirmListItem.tsx @@ -1,8 +1,8 @@ +import { Address } from '@ton/core'; import { BLOCKCHAIN_NAME, CryptoCurrency } from '@tonkeeper/core/dist/entries/crypto'; import { RecipientData, isTonRecipientData } from '@tonkeeper/core/dist/entries/send'; import { toShortValue } from '@tonkeeper/core/dist/utils/common'; -import React, { FC } from 'react'; -import { Address } from 'ton-core'; +import { FC } from 'react'; import { useWalletContext } from '../../hooks/appContext'; import { useAppSdk } from '../../hooks/appSdk'; import { useTranslation } from '../../hooks/translation'; diff --git a/packages/uikit/src/hooks/blockchain/useEstimateTransfer.ts b/packages/uikit/src/hooks/blockchain/useEstimateTransfer.ts index da061bf20..47d1b00d5 100644 --- a/packages/uikit/src/hooks/blockchain/useEstimateTransfer.ts +++ b/packages/uikit/src/hooks/blockchain/useEstimateTransfer.ts @@ -1,4 +1,5 @@ import { useQuery, useQueryClient } from '@tanstack/react-query'; +import { Address } from '@ton/core'; import { APIConfig } from '@tonkeeper/core/dist/entries/apis'; import { Asset, isTonAsset } from '@tonkeeper/core/dist/entries/crypto/asset/asset'; import { AssetAmount } from '@tonkeeper/core/dist/entries/crypto/asset/asset-amount'; @@ -15,7 +16,6 @@ import { estimateJettonTransfer } from '@tonkeeper/core/dist/service/transfer/je import { estimateTonTransfer } from '@tonkeeper/core/dist/service/transfer/tonService'; import { estimateTron } from '@tonkeeper/core/dist/service/tron/tronTransferService'; import { JettonsBalances, MessageConsequences } from '@tonkeeper/core/dist/tonApiV2'; -import { Address } from 'ton-core'; import { notifyError } from '../../components/transfer/common'; import { QueryKey } from '../../libs/queryKey'; import { DefaultRefetchInterval } from '../../state/tonendpoint'; diff --git a/packages/uikit/src/hooks/blockchain/useSendTransfer.ts b/packages/uikit/src/hooks/blockchain/useSendTransfer.ts index f8f8fc4f3..437070506 100644 --- a/packages/uikit/src/hooks/blockchain/useSendTransfer.ts +++ b/packages/uikit/src/hooks/blockchain/useSendTransfer.ts @@ -1,4 +1,5 @@ import { useMutation, useQueryClient } from '@tanstack/react-query'; +import { Address } from '@ton/core'; import { Asset, isTonAsset } from '@tonkeeper/core/dist/entries/crypto/asset/asset'; import { AssetAmount } from '@tonkeeper/core/dist/entries/crypto/asset/asset-amount'; import { TON_ASSET } from '@tonkeeper/core/dist/entries/crypto/asset/constants'; @@ -13,7 +14,6 @@ import { sendTonTransfer } from '@tonkeeper/core/dist/service/transfer/tonServic import { sendTronTransfer } from '@tonkeeper/core/dist/service/tron/tronTransferService'; import { MessageConsequences } from '@tonkeeper/core/dist/tonApiV2'; import { EstimatePayload } from '@tonkeeper/core/dist/tronApi'; -import { Address } from 'ton-core'; import { notifyError } from '../../components/transfer/common'; import { getMnemonic } from '../../state/mnemonic'; import { useWalletJettonList } from '../../state/wallet'; diff --git a/packages/uikit/src/pages/coin/Jetton.tsx b/packages/uikit/src/pages/coin/Jetton.tsx index 2ba21409a..9d19ad918 100644 --- a/packages/uikit/src/pages/coin/Jetton.tsx +++ b/packages/uikit/src/pages/coin/Jetton.tsx @@ -1,9 +1,9 @@ import { useInfiniteQuery } from '@tanstack/react-query'; +import { Address } from '@ton/core'; import { BLOCKCHAIN_NAME } from '@tonkeeper/core/dist/entries/crypto'; import { AccountsApi, JettonBalance, JettonInfo } from '@tonkeeper/core/dist/tonApiV2'; import { formatDecimals } from '@tonkeeper/core/dist/utils/balance'; import React, { FC, useMemo, useRef } from 'react'; -import { Address } from 'ton-core'; import { InnerBody } from '../../components/Body'; import { CoinSkeletonPage } from '../../components/Skeleton'; import { SubHeader } from '../../components/SubHeader'; diff --git a/packages/uikit/src/pages/import/Create.tsx b/packages/uikit/src/pages/import/Create.tsx index a264d6f97..0e26aabfc 100644 --- a/packages/uikit/src/pages/import/Create.tsx +++ b/packages/uikit/src/pages/import/Create.tsx @@ -1,7 +1,7 @@ +import { mnemonicNew } from '@ton/crypto'; import { AccountState } from '@tonkeeper/core/dist/entries/account'; import { AuthState } from '@tonkeeper/core/dist/entries/password'; -import React, { FC, useEffect, useState } from 'react'; -import { mnemonicNew } from 'ton-crypto'; +import { FC, useEffect, useState } from 'react'; import { IconPage } from '../../components/Layout'; import { CreateAuthState } from '../../components/create/CreateAuth'; import { UpdateWalletName } from '../../components/create/WalletName'; diff --git a/packages/uikit/src/pages/import/Password.tsx b/packages/uikit/src/pages/import/Password.tsx index 2dc3afb97..28d174f4b 100644 --- a/packages/uikit/src/pages/import/Password.tsx +++ b/packages/uikit/src/pages/import/Password.tsx @@ -1,4 +1,5 @@ import { QueryClient, useMutation, useQueryClient } from '@tanstack/react-query'; +import { mnemonicValidate } from '@ton/crypto'; import { IAppSdk } from '@tonkeeper/core/dist/AppSdk'; import { AppKey } from '@tonkeeper/core/dist/Keys'; import { AccountState } from '@tonkeeper/core/dist/entries/account'; @@ -12,9 +13,8 @@ import { createNewWalletState, encryptWalletMnemonic } from '@tonkeeper/core/dist/service/walletService'; -import React, { useEffect, useState } from 'react'; +import { useEffect, useState } from 'react'; import styled from 'styled-components'; -import { mnemonicValidate } from 'ton-crypto'; import { IconPage } from '../../components/Layout'; import { CheckLottieIcon, ConfettiLottieIcon } from '../../components/lottie/LottieIcons'; import { useAppContext } from '../../hooks/appContext'; diff --git a/packages/uikit/src/state/asset.ts b/packages/uikit/src/state/asset.ts index 58cdcf2b4..cd75131d8 100644 --- a/packages/uikit/src/state/asset.ts +++ b/packages/uikit/src/state/asset.ts @@ -1,3 +1,4 @@ +import { Address } from '@ton/core'; import { BLOCKCHAIN_NAME } from '@tonkeeper/core/dist/entries/crypto'; import { Asset } from '@tonkeeper/core/dist/entries/crypto/asset/asset'; import { AssetAmount } from '@tonkeeper/core/dist/entries/crypto/asset/asset-amount'; @@ -7,7 +8,6 @@ import { TON_ASSET, TRON_USDT_ASSET } from '@tonkeeper/core/dist/entries/crypto/ import { TonAsset, legacyTonAssetId } from '@tonkeeper/core/dist/entries/crypto/asset/ton-asset'; import { TronAsset } from '@tonkeeper/core/dist/entries/crypto/asset/tron-asset'; import BigNumber from 'bignumber.js'; -import { Address } from 'ton-core'; import { useRate } from './rates'; import { useTronBalances } from './tron/tron'; import { useWalletAccountInfo, useWalletJettonList } from './wallet'; diff --git a/packages/uikit/src/state/dashboard/useDashboardData.ts b/packages/uikit/src/state/dashboard/useDashboardData.ts index 3097216ed..c6c4e2261 100644 --- a/packages/uikit/src/state/dashboard/useDashboardData.ts +++ b/packages/uikit/src/state/dashboard/useDashboardData.ts @@ -1,14 +1,14 @@ import { useQuery, useQueryClient } from '@tanstack/react-query'; -import { QueryKey } from '../../libs/queryKey'; -import { ClientColumns, useDashboardColumnsAsForm } from './useDashboardColumns'; -import { useAppContext } from '../../hooks/appContext'; +import { Address } from '@ton/core'; import { DashboardCell } from '@tonkeeper/core/dist/entries/dashboard'; +import { Network } from '@tonkeeper/core/dist/entries/network'; +import { WalletState } from '@tonkeeper/core/dist/entries/wallet'; import { getDashboardData } from '@tonkeeper/core/dist/service/proService'; +import { useAppContext } from '../../hooks/appContext'; import { useTranslation } from '../../hooks/translation'; -import { WalletState } from '@tonkeeper/core/dist/entries/wallet'; -import { Address } from 'ton-core'; -import { Network } from '@tonkeeper/core/dist/entries/network'; +import { QueryKey } from '../../libs/queryKey'; import { useWalletsState } from '../wallet'; +import { ClientColumns, useDashboardColumnsAsForm } from './useDashboardColumns'; export function useDashboardData() { const { data: columns } = useDashboardColumnsAsForm(); diff --git a/packages/uikit/src/state/mnemonic.ts b/packages/uikit/src/state/mnemonic.ts index 7bad34648..a4e91e21f 100644 --- a/packages/uikit/src/state/mnemonic.ts +++ b/packages/uikit/src/state/mnemonic.ts @@ -1,8 +1,8 @@ +import { mnemonicToPrivateKey, sha256_sync } from '@ton/crypto'; import { IAppSdk } from '@tonkeeper/core/dist/AppSdk'; import { AppKey } from '@tonkeeper/core/dist/Keys'; import { AuthState } from '@tonkeeper/core/dist/entries/password'; import { getWalletMnemonic } from '@tonkeeper/core/dist/service/mnemonicService'; -import { mnemonicToPrivateKey, sha256_sync } from 'ton-crypto'; import nacl from 'tweetnacl'; export const signTonConnect = (sdk: IAppSdk, publicKey: string) => { diff --git a/packages/uikit/src/state/wallet.ts b/packages/uikit/src/state/wallet.ts index 6872a6d8b..5c3f1ebf6 100644 --- a/packages/uikit/src/state/wallet.ts +++ b/packages/uikit/src/state/wallet.ts @@ -1,4 +1,7 @@ import { QueryClient, useMutation, useQuery, useQueryClient } from '@tanstack/react-query'; +import { Address } from '@ton/core'; +import { CryptoCurrency } from '@tonkeeper/core/dist/entries/crypto'; +import { FiatCurrencies } from '@tonkeeper/core/dist/entries/fiat'; import { NFT } from '@tonkeeper/core/dist/entries/nft'; import { WalletState, WalletVersion, walletVersionText } from '@tonkeeper/core/dist/entries/wallet'; import { accountLogOutWallet, getAccountState } from '@tonkeeper/core/dist/service/accountService'; @@ -16,20 +19,17 @@ import { NftItem, WalletApi } from '@tonkeeper/core/dist/tonApiV2'; +import { shiftedDecimals } from '@tonkeeper/core/dist/utils/balance'; import { isTONDNSDomain } from '@tonkeeper/core/dist/utils/nft'; -import { Address } from 'ton'; +import BigNumber from 'bignumber.js'; +import { AssetData } from '../components/home/Jettons'; import { useAppContext, useWalletContext } from '../hooks/appContext'; import { useAppSdk } from '../hooks/appSdk'; import { useStorage } from '../hooks/storage'; import { JettonKey, QueryKey } from '../libs/queryKey'; -import { getRateKey, TokenRate, toTokenRate } from './rates'; -import { DefaultRefetchInterval } from './tonendpoint'; -import BigNumber from 'bignumber.js'; -import { FiatCurrencies } from '@tonkeeper/core/dist/entries/fiat'; -import { AssetData } from '../components/home/Jettons'; -import { CryptoCurrency } from '@tonkeeper/core/dist/entries/crypto'; -import { shiftedDecimals } from '@tonkeeper/core/dist/utils/balance'; import { useAssets } from './home'; +import { TokenRate, getRateKey, toTokenRate } from './rates'; +import { DefaultRefetchInterval } from './tonendpoint'; export const useActiveWallet = () => { const sdk = useAppSdk(); diff --git a/yarn.lock b/yarn.lock index 71137128e..052cc582c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6033,17 +6033,64 @@ __metadata: languageName: node linkType: hard +"@ton/core@npm:0.54.0": + version: 0.54.0 + resolution: "@ton/core@npm:0.54.0" + dependencies: + symbol.inspect: "npm:1.0.1" + peerDependencies: + "@ton/crypto": ">=3.2.0" + checksum: 2af2f369ed9ce83e985550cdca078c332fa4ac2842d213ed4b9e0615ddba3ce2c9571f5ea99a4f3a9d8d3e3a3df347815b5454cb09c99bca282a5ca7dcf0ab92 + languageName: node + linkType: hard + +"@ton/crypto-primitives@npm:2.0.0": + version: 2.0.0 + resolution: "@ton/crypto-primitives@npm:2.0.0" + dependencies: + jssha: "npm:3.2.0" + checksum: 1a686b04dc1430792341339f0ddc1e2f5effd94d31ae118baf2c510e074201495801787b2ca881a6ceb587f89212eb081ec9e3979d374d9c9004c6c4b61fc591 + languageName: node + linkType: hard + +"@ton/crypto@npm:3.2.0": + version: 3.2.0 + resolution: "@ton/crypto@npm:3.2.0" + dependencies: + "@ton/crypto-primitives": "npm:2.0.0" + jssha: "npm:3.2.0" + tweetnacl: "npm:1.0.3" + checksum: 7179020da4daa61114af3e507856308cff08d8fdecb1ed973c26434d6cac42f9e7551fdfbbc16940c95578b0842f0524c9d55762c42a55b10e6421b49582bd75 + languageName: node + linkType: hard + +"@ton/ton@https://github.com/tonkeeper/tonkeeper-ton#build4": + version: 13.9.0 + resolution: "@ton/ton@https://github.com/tonkeeper/tonkeeper-ton.git#commit=305a0cbf1f498c2ab03f70e3b547379195adcbbd" + dependencies: + axios: "npm:^0.25.0" + dataloader: "npm:^2.0.0" + symbol.inspect: "npm:1.0.1" + teslabot: "npm:^1.3.0" + zod: "npm:^3.21.4" + peerDependencies: + "@ton/core": ">=0.53.0" + "@ton/crypto": ">=3.2.0" + checksum: 574826c6f85ee20471dbbad5fc32c82b869983eb9eb7bf9a2b1682b8d17f6f55b2e74ea41608f7dbc1dc1d08177f158c6813ec7cb37ccfc2d48f0968f16e0a4a + languageName: node + linkType: hard + "@tonkeeper/core@npm:0.1.0, @tonkeeper/core@workspace:packages/core": version: 0.0.0-use.local resolution: "@tonkeeper/core@workspace:packages/core" dependencies: + "@ton/core": "npm:0.54.0" + "@ton/crypto": "npm:3.2.0" + "@ton/ton": "https://github.com/tonkeeper/tonkeeper-ton#build4" bignumber.js: "npm:^9.1.1" ethers: "npm:^6.6.5" npm-run-all: "npm:^4.1.5" query-string: "npm:^8.1.0" - ton: "npm:^13.4.1" - ton-core: "npm:^0.49.0" - ton-crypto: "npm:^3.2.0" tweetnacl: "npm:^1.0.3" typescript: "npm:^4.9.4" yarn-run-all: "npm:^3.1.1" @@ -6147,9 +6194,6 @@ __metadata: react-scripts: "npm:5.0.1" stream-browserify: "npm:^3.0.0" styled-components: "npm:^6.1.1" - ton: "npm:^13.4.1" - ton-core: "npm:^0.49.0" - ton-crypto: "npm:^3.2.0" ts-loader: "npm:^9.4.2" ts-node: "npm:^10.9.1" typescript: "npm:^4.9.4" @@ -6230,6 +6274,8 @@ __metadata: "@storybook/react": "npm:^6.5.14" "@storybook/testing-library": "npm:^0.0.13" "@tanstack/react-query": "npm:4.3.4" + "@ton/core": "npm:0.54.0" + "@ton/crypto": "npm:3.2.0" "@tonkeeper/core": "npm:0.1.0" "@types/country-list-js": "npm:^3.1.3" "@types/react": "npm:^18.0.26" @@ -6259,9 +6305,7 @@ __metadata: slick-carousel: "npm:^1.8.1" storybook-addon-turbo-build: "npm:^1.1.0" styled-components: "npm:^6.1.1" - ton: "npm:^13.4.1" - ton-core: "npm:^0.49.0" - ton-crypto: "npm:^3.2.0" + tweetnacl: "npm:^1.0.3" typescript: "npm:^4.9.4" uuid: "npm:^9.0.0" webpack: "npm:^5.88.2" @@ -24881,53 +24925,6 @@ __metadata: languageName: node linkType: hard -"ton-core@npm:^0.49.0": - version: 0.49.1 - resolution: "ton-core@npm:0.49.1" - dependencies: - symbol.inspect: "npm:1.0.1" - peerDependencies: - ton-crypto: ">=3.2.0" - checksum: aec84dcd1756cc33943e53ca097107da468dc84cc904ab8222a9914fa5a44bfae0a73ec2f702ab0ba10c5abf2f9d63a4b6456d70b44860c5def33d4f9a776db1 - languageName: node - linkType: hard - -"ton-crypto-primitives@npm:2.0.0": - version: 2.0.0 - resolution: "ton-crypto-primitives@npm:2.0.0" - dependencies: - jssha: "npm:3.2.0" - checksum: a81e5e7f1e44a2f32c519d6a9c3512c047b837be2f90a4e5aa226378b330ec6f9d36c1937a21b947eb792ae819c6906cfbd5b5eeab891f9df486d570141fc749 - languageName: node - linkType: hard - -"ton-crypto@npm:^3.2.0": - version: 3.2.0 - resolution: "ton-crypto@npm:3.2.0" - dependencies: - jssha: "npm:3.2.0" - ton-crypto-primitives: "npm:2.0.0" - tweetnacl: "npm:1.0.3" - checksum: 2679026f38ef8c2652b0caaaf4a9765d347655dec0fc7c8875efd0b6c42b1052bbf83b8b2e8a91fe6a2ffa5b84030d447707cf6cdd98634cd39ab8620e9ee24a - languageName: node - linkType: hard - -"ton@npm:^13.4.1": - version: 13.9.0 - resolution: "ton@npm:13.9.0" - dependencies: - axios: "npm:^0.25.0" - dataloader: "npm:^2.0.0" - symbol.inspect: "npm:1.0.1" - teslabot: "npm:^1.3.0" - zod: "npm:^3.21.4" - peerDependencies: - ton-core: ">=0.53.0" - ton-crypto: ">=3.2.0" - checksum: ea77010ee037ab45136674f7ee64bfea923ea4d29127035c27e3facdb79fea640909795dc4884c68acf0349bdb0df592e5c5b9c8f9c23323ea3f203a940fd0e3 - languageName: node - linkType: hard - "tonkeeper-web@workspace:.": version: 0.0.0-use.local resolution: "tonkeeper-web@workspace:." From e348db238caf613b58ec5fe8d1297ebd593ae6c9 Mon Sep 17 00:00:00 2001 From: Nikita Kuznetsov Date: Mon, 18 Mar 2024 17:00:33 +0100 Subject: [PATCH 02/10] Add W5 --- apps/desktop/src/app/App.tsx | 1 + packages/core/src/entries/wallet.ts | 7 +++- packages/core/src/service/transfer/common.ts | 3 +- .../src/service/wallet/contractService.ts | 18 ++++++++-- packages/core/src/service/walletService.ts | 2 +- packages/uikit/src/hooks/appContext.ts | 1 + packages/uikit/src/libs/queryKey.ts | 1 + packages/uikit/src/pages/settings/Dev.tsx | 33 ++++++++++++------- packages/uikit/src/pages/settings/Version.tsx | 24 ++++++++++---- packages/uikit/src/state/experemental.ts | 21 ++++++++++++ 10 files changed, 88 insertions(+), 23 deletions(-) create mode 100644 packages/uikit/src/state/experemental.ts diff --git a/apps/desktop/src/app/App.tsx b/apps/desktop/src/app/App.tsx index dfdef75ea..e90ed7cce 100644 --- a/apps/desktop/src/app/App.tsx +++ b/apps/desktop/src/app/App.tsx @@ -263,6 +263,7 @@ export const Loader: FC = () => { standalone: true, extension: false, proFeatures: true, + experimental: true, ios: false, env: { tgAuthBotId: REACT_APP_TG_BOT_ID diff --git a/packages/core/src/entries/wallet.ts b/packages/core/src/entries/wallet.ts index bc06e3306..c53212e39 100644 --- a/packages/core/src/entries/wallet.ts +++ b/packages/core/src/entries/wallet.ts @@ -7,7 +7,8 @@ export enum WalletVersion { V3R1 = 0, V3R2 = 1, V4R1 = 2, - V4R2 = 3 + V4R2 = 3, + W5 = 4 } export const WalletVersions = [WalletVersion.V3R1, WalletVersion.V3R2, WalletVersion.V4R2]; @@ -20,6 +21,8 @@ export const walletVersionText = (version: WalletVersion) => { return 'v3R2'; case WalletVersion.V4R2: return 'v4R2'; + case WalletVersion.W5: + return 'W5'; default: return String(version); } @@ -33,6 +36,8 @@ export const walletVersionFromText = (value: string) => { return WalletVersion.V3R2; case 'v4R2': return WalletVersion.V4R2; + case 'W5': + return WalletVersion.W5; default: throw new Error('Unsupported version'); } diff --git a/packages/core/src/service/transfer/common.ts b/packages/core/src/service/transfer/common.ts index 3bb64df63..ad5860d50 100644 --- a/packages/core/src/service/transfer/common.ts +++ b/packages/core/src/service/transfer/common.ts @@ -12,6 +12,7 @@ import { mnemonicToPrivateKey } from '@ton/crypto'; import { WalletContractV3R1 } from '@ton/ton/dist/wallets/WalletContractV3R1'; import { WalletContractV3R2 } from '@ton/ton/dist/wallets/WalletContractV3R2'; import { WalletContractV4 } from '@ton/ton/dist/wallets/WalletContractV4'; +import { WalletContractV5 } from '@ton/ton/dist/wallets/WalletContractV5'; import BigNumber from 'bignumber.js'; import nacl from 'tweetnacl'; import { APIConfig } from '../../entries/apis'; @@ -35,7 +36,7 @@ export enum SendMode { } export const externalMessage = ( - contract: WalletContractV3R1 | WalletContractV3R2 | WalletContractV4, + contract: WalletContractV3R1 | WalletContractV3R2 | WalletContractV4 | WalletContractV5, seqno: number, body: Cell ) => { diff --git a/packages/core/src/service/wallet/contractService.ts b/packages/core/src/service/wallet/contractService.ts index 7864b4946..b7932e89d 100644 --- a/packages/core/src/service/wallet/contractService.ts +++ b/packages/core/src/service/wallet/contractService.ts @@ -2,16 +2,22 @@ import { beginCell, storeStateInit } from '@ton/core'; import { WalletContractV3R1 } from '@ton/ton/dist/wallets/WalletContractV3R1'; import { WalletContractV3R2 } from '@ton/ton/dist/wallets/WalletContractV3R2'; import { WalletContractV4 } from '@ton/ton/dist/wallets/WalletContractV4'; +import { WalletContractV5 } from '@ton/ton/dist/wallets/WalletContractV5'; +import { Network } from '../../entries/network'; import { WalletState, WalletVersion } from '../../entries/wallet'; export const walletContractFromState = (wallet: WalletState) => { const publicKey = Buffer.from(wallet.publicKey, 'hex'); - return walletContract(publicKey, wallet.active.version); + return walletContract(publicKey, wallet.active.version, wallet.network); }; const workchain = 0; -export const walletContract = (publicKey: Buffer, version: WalletVersion) => { +export const walletContract = ( + publicKey: Buffer, + version: WalletVersion, + network: Network | undefined +) => { switch (version) { case WalletVersion.V3R1: return WalletContractV3R1.create({ workchain, publicKey }); @@ -21,6 +27,14 @@ export const walletContract = (publicKey: Buffer, version: WalletVersion) => { throw new Error('Unsupported wallet contract version - v4R1'); case WalletVersion.V4R2: return WalletContractV4.create({ workchain, publicKey }); + case WalletVersion.W5: + return WalletContractV5.create({ + walletId: { + workChain: workchain, + networkGlobalId: network + }, + publicKey + }); } }; diff --git a/packages/core/src/service/walletService.ts b/packages/core/src/service/walletService.ts index cba6cc3bd..3fbb45202 100644 --- a/packages/core/src/service/walletService.ts +++ b/packages/core/src/service/walletService.ts @@ -99,7 +99,7 @@ export const getWalletAddress = ( version: WalletVersion, network?: Network ): WalletAddress => { - const { address } = walletContract(publicKey, version); + const { address } = walletContract(publicKey, version, network); return { rawAddress: address.toRawString(), friendlyAddress: address.toString({ diff --git a/packages/uikit/src/hooks/appContext.ts b/packages/uikit/src/hooks/appContext.ts index bae524d79..9aa8272db 100644 --- a/packages/uikit/src/hooks/appContext.ts +++ b/packages/uikit/src/hooks/appContext.ts @@ -23,6 +23,7 @@ export interface IAppContext { extension: boolean; ios: boolean; proFeatures: boolean; + experimental?: boolean; hideQrScanner?: boolean; env?: { tgAuthBotId: string; diff --git a/packages/uikit/src/libs/queryKey.ts b/packages/uikit/src/libs/queryKey.ts index 556d72159..598b3ad2e 100644 --- a/packages/uikit/src/libs/queryKey.ts +++ b/packages/uikit/src/libs/queryKey.ts @@ -21,6 +21,7 @@ export enum QueryKey { connection = 'connection', subscribed = 'subscribed', featuredRecommendations = 'recommendations', + experimental = 'experimental', tron = 'tron', rate = 'rate', diff --git a/packages/uikit/src/pages/settings/Dev.tsx b/packages/uikit/src/pages/settings/Dev.tsx index e31d9dcce..8d21e2aa3 100644 --- a/packages/uikit/src/pages/settings/Dev.tsx +++ b/packages/uikit/src/pages/settings/Dev.tsx @@ -5,15 +5,33 @@ import { SubHeader } from '../../components/SubHeader'; import { SettingsItem, SettingsList } from '../../components/settings/SettingsList'; import { useWalletContext } from '../../hooks/appContext'; import { useTranslation } from '../../hooks/translation'; -import { useCleanUpTronStore } from '../../state/tron/tron'; +import { useEnableW5, useEnableW5Mutation } from '../../state/experemental'; import { useMutateWalletProperty } from '../../state/wallet'; +const SettingsW5 = () => { + const { data } = useEnableW5(); + const { mutate } = useEnableW5Mutation(); + + const experimental = useMemo(() => { + return [ + { + name: 'Experimental W5', + icon: data ? 'Active' : 'Inactive', + action: () => mutate() + } + ]; + }, [data, mutate]); + + if (data === undefined) return null; + + return ; +}; + export const DevSettings = React.memo(() => { const { t } = useTranslation(); const wallet = useWalletContext(); const { mutate } = useMutateWalletProperty(true); - const { mutate: mutateTron } = useCleanUpTronStore(); const items = useMemo(() => { const network = wallet.network ?? Network.MAINNET; @@ -26,16 +44,6 @@ export const DevSettings = React.memo(() => { ]; }, [t, wallet]); - const _items2 = useMemo(() => { - return [ - { - name: t('reset_tron_cache'), - icon: wallet.tron ? 'Active' : 'Inactive', - action: () => mutateTron() - } - ]; - }, [t, wallet, mutateTron]); - return ( <> @@ -43,6 +51,7 @@ export const DevSettings = React.memo(() => { {/* TODO: ENABLE TRON */} {/* */} + ); diff --git a/packages/uikit/src/pages/settings/Version.tsx b/packages/uikit/src/pages/settings/Version.tsx index d49f7ac3f..e5f263d5e 100644 --- a/packages/uikit/src/pages/settings/Version.tsx +++ b/packages/uikit/src/pages/settings/Version.tsx @@ -1,25 +1,37 @@ -import { WalletVersions, walletVersionText } from '@tonkeeper/core/dist/entries/wallet'; +import { + WalletVersion as WalletVersionEnum, + WalletVersions, + walletVersionText +} from '@tonkeeper/core/dist/entries/wallet'; import { getWalletAddress } from '@tonkeeper/core/dist/service/walletService'; import { toShortValue } from '@tonkeeper/core/dist/utils/common'; -import React, { useMemo } from 'react'; +import { useMemo } from 'react'; import { InnerBody } from '../../components/Body'; import { CheckIcon } from '../../components/Icon'; import { SubHeader } from '../../components/SubHeader'; import { SettingsItem, SettingsList } from '../../components/settings/SettingsList'; -import { useWalletContext } from '../../hooks/appContext'; +import { useAppContext, useWalletContext } from '../../hooks/appContext'; import { useTranslation } from '../../hooks/translation'; import { useMutateWalletVersion } from '../../state/account'; +import { useEnableW5 } from '../../state/experemental'; export const WalletVersion = () => { const { t } = useTranslation(); - + const { experimental } = useAppContext(); + const { data: enableW5 } = useEnableW5(); const wallet = useWalletContext(); const { mutate, isLoading } = useMutateWalletVersion(); const items = useMemo(() => { const publicKey = Buffer.from(wallet.publicKey, 'hex'); - return WalletVersions.map(item => ({ + let list = [...WalletVersions]; + + if (experimental && enableW5) { + list.push(WalletVersionEnum.W5); + } + + return list.map(item => ({ name: walletVersionText(item), secondary: toShortValue( getWalletAddress(publicKey, item, wallet.network).friendlyAddress @@ -27,7 +39,7 @@ export const WalletVersion = () => { icon: wallet.active.version === item ? : undefined, action: () => mutate(item) })); - }, [wallet, mutate]); + }, [wallet, mutate, experimental, enableW5]); return ( <> diff --git a/packages/uikit/src/state/experemental.ts b/packages/uikit/src/state/experemental.ts new file mode 100644 index 000000000..4442551a0 --- /dev/null +++ b/packages/uikit/src/state/experemental.ts @@ -0,0 +1,21 @@ +import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query'; +import { useAppSdk } from '../hooks/appSdk'; +import { QueryKey } from '../libs/queryKey'; + +export const useEnableW5 = () => { + const sdk = useAppSdk(); + return useQuery([QueryKey.experimental, 'w5'], async () => { + const state = await sdk.storage.get(`${QueryKey.experimental}_w5`); + return state ?? false; + }); +}; + +export const useEnableW5Mutation = () => { + const sdk = useAppSdk(); + const client = useQueryClient(); + return useMutation(async () => { + const state = await sdk.storage.get(`${QueryKey.experimental}_w5`); + await sdk.storage.set(`${QueryKey.experimental}_w5`, !state); + await client.invalidateQueries([QueryKey.experimental]); + }); +}; From e45af816acf248aa190c6ace176d884915bb13e2 Mon Sep 17 00:00:00 2001 From: Nikita Kuznetsov Date: Mon, 18 Mar 2024 17:14:24 +0100 Subject: [PATCH 03/10] Update emulation --- packages/core/src/entries/send.ts | 6 ++-- packages/core/src/service/transfer/common.ts | 11 ++----- .../src/service/transfer/jettonService.ts | 16 +++++----- .../core/src/service/transfer/nftService.ts | 19 ++++++------ .../core/src/service/transfer/tonService.ts | 31 +++++++++---------- .../activity/NotificationCommon.tsx | 8 ++--- packages/uikit/src/components/nft/LinkNft.tsx | 6 ++-- .../uikit/src/components/nft/RenewNft.tsx | 6 ++-- .../transfer/nft/ConfirmNftView.tsx | 13 ++++++-- .../src/hooks/blockchain/nft/useLinkNft.ts | 4 +-- .../src/hooks/blockchain/nft/useRenewNft.ts | 4 +-- .../src/hooks/blockchain/useEstimateTonFee.ts | 9 +++--- .../hooks/blockchain/useEstimateTransfer.ts | 7 +++-- .../hooks/blockchain/useExecuteTonContract.ts | 4 +-- .../src/hooks/blockchain/useSendTransfer.ts | 6 ++-- 15 files changed, 78 insertions(+), 72 deletions(-) diff --git a/packages/core/src/entries/send.ts b/packages/core/src/entries/send.ts index 6a3412f02..6b6680c27 100644 --- a/packages/core/src/entries/send.ts +++ b/packages/core/src/entries/send.ts @@ -1,4 +1,4 @@ -import { Account, MessageConsequences, WalletDNS } from '../tonApiV2'; +import { Account, AccountEvent, WalletDNS } from '../tonApiV2'; import { EstimatePayload } from '../tronApi'; import { BLOCKCHAIN_NAME } from './crypto'; import { Asset } from './crypto/asset/asset'; @@ -54,8 +54,10 @@ export function isTronRecipientData( export type TransferEstimation = { fee: AssetAmount; payload: T extends TonAsset - ? MessageConsequences + ? TransferEstimationEvent : T extends TronAsset ? EstimatePayload : never; }; + +export type TransferEstimationEvent = { event: AccountEvent }; diff --git a/packages/core/src/service/transfer/common.ts b/packages/core/src/service/transfer/common.ts index ad5860d50..ade5c4a44 100644 --- a/packages/core/src/service/transfer/common.ts +++ b/packages/core/src/service/transfer/common.ts @@ -16,14 +16,9 @@ import { WalletContractV5 } from '@ton/ton/dist/wallets/WalletContractV5'; import BigNumber from 'bignumber.js'; import nacl from 'tweetnacl'; import { APIConfig } from '../../entries/apis'; +import { TransferEstimationEvent } from '../../entries/send'; import { WalletState } from '../../entries/wallet'; -import { - Account, - AccountsApi, - LiteServerApi, - MessageConsequences, - WalletApi -} from '../../tonApiV2'; +import { Account, AccountsApi, LiteServerApi, WalletApi } from '../../tonApiV2'; import { walletContractFromState } from '../wallet/contractService'; export enum SendMode { @@ -152,7 +147,7 @@ export const createTransferMessage = ( export async function getKeyPairAndSeqno(options: { api: APIConfig; walletState: WalletState; - fee: MessageConsequences; + fee: TransferEstimationEvent; mnemonic: string[]; amount: BigNumber; }) { diff --git a/packages/core/src/service/transfer/jettonService.ts b/packages/core/src/service/transfer/jettonService.ts index 4c8014e21..104f59847 100644 --- a/packages/core/src/service/transfer/jettonService.ts +++ b/packages/core/src/service/transfer/jettonService.ts @@ -4,9 +4,9 @@ import BigNumber from 'bignumber.js'; import { APIConfig } from '../../entries/apis'; import { AssetAmount } from '../../entries/crypto/asset/asset-amount'; import { TonAsset } from '../../entries/crypto/asset/ton-asset'; -import { TonRecipientData } from '../../entries/send'; +import { TonRecipientData, TransferEstimationEvent } from '../../entries/send'; import { WalletState } from '../../entries/wallet'; -import { BlockchainApi, EmulationApi, MessageConsequences } from '../../tonApiV2'; +import { BlockchainApi, EmulationApi } from '../../tonApiV2'; import { walletContractFromState } from '../wallet/contractService'; import { checkServiceTimeOrDie, @@ -87,7 +87,7 @@ export const estimateJettonTransfer = async ( recipient: TonRecipientData, amount: AssetAmount, jettonWalletAddress: string -) => { +): Promise => { await checkServiceTimeOrDie(api); const [wallet, seqno] = await getWalletBalance(api, walletState); checkWalletPositiveBalanceOrDie(wallet); @@ -101,10 +101,12 @@ export const estimateJettonTransfer = async ( recipient.comment ? comment(recipient.comment) : null ); - const emulation = await new EmulationApi(api.tonApiV2).emulateMessageToWallet({ - emulateMessageToWalletRequest: { boc: cell.toString('base64') } + const event = await new EmulationApi(api.tonApiV2).emulateMessageToAccountEvent({ + accountId: wallet.address, + decodeMessageRequest: { boc: cell.toString('base64') } }); - return emulation; + + return { event }; }; export const sendJettonTransfer = async ( @@ -113,7 +115,7 @@ export const sendJettonTransfer = async ( recipient: TonRecipientData, amount: AssetAmount, jettonWalletAddress: string, - fee: MessageConsequences, + fee: TransferEstimationEvent, mnemonic: string[] ) => { await checkServiceTimeOrDie(api); diff --git a/packages/core/src/service/transfer/nftService.ts b/packages/core/src/service/transfer/nftService.ts index 957f367a9..8a10aff4c 100644 --- a/packages/core/src/service/transfer/nftService.ts +++ b/packages/core/src/service/transfer/nftService.ts @@ -2,9 +2,9 @@ import { Address, beginCell, Cell, comment, toNano } from '@ton/core'; import { mnemonicToPrivateKey } from '@ton/crypto'; import BigNumber from 'bignumber.js'; import { APIConfig } from '../../entries/apis'; -import { TonRecipientData } from '../../entries/send'; +import { TonRecipientData, TransferEstimationEvent } from '../../entries/send'; import { WalletState } from '../../entries/wallet'; -import { BlockchainApi, EmulationApi, MessageConsequences, NftItem } from '../../tonApiV2'; +import { BlockchainApi, EmulationApi, NftItem } from '../../tonApiV2'; import { checkServiceTimeOrDie, checkWalletBalanceOrDie, @@ -91,7 +91,7 @@ export const estimateNftTransfer = async ( walletState: WalletState, recipient: TonRecipientData, nftItem: NftItem -) => { +): Promise => { await checkServiceTimeOrDie(api); const [wallet, seqno] = await getWalletBalance(api, walletState); checkWalletPositiveBalanceOrDie(wallet); @@ -105,10 +105,11 @@ export const estimateNftTransfer = async ( recipient.comment ? comment(recipient.comment) : null ); - const emulation = await new EmulationApi(api.tonApiV2).emulateMessageToWallet({ - emulateMessageToWalletRequest: { boc: cell.toString('base64') } + const event = await new EmulationApi(api.tonApiV2).emulateMessageToAccountEvent({ + accountId: wallet.address, + decodeMessageRequest: { boc: cell.toString('base64') } }); - return emulation; + return { event }; }; export const sendNftTransfer = async ( @@ -116,7 +117,7 @@ export const sendNftTransfer = async ( walletState: WalletState, recipient: TonRecipientData, nftItem: NftItem, - fee: MessageConsequences, + fee: TransferEstimationEvent, mnemonic: string[] ) => { await checkServiceTimeOrDie(api); @@ -155,7 +156,7 @@ export const sendNftRenew = async (options: { api: APIConfig; walletState: WalletState; nftAddress: string; - fee: MessageConsequences; + fee: TransferEstimationEvent; mnemonic: string[]; amount: BigNumber; }) => { @@ -206,7 +207,7 @@ export const sendNftLink = async (options: { walletState: WalletState; nftAddress: string; linkToAddress: string; - fee: MessageConsequences; + fee: TransferEstimationEvent; mnemonic: string[]; amount: BigNumber; }) => { diff --git a/packages/core/src/service/transfer/tonService.ts b/packages/core/src/service/transfer/tonService.ts index 908ecade9..18b1faaa3 100644 --- a/packages/core/src/service/transfer/tonService.ts +++ b/packages/core/src/service/transfer/tonService.ts @@ -4,16 +4,10 @@ import { mnemonicToPrivateKey } from '@ton/crypto'; import BigNumber from 'bignumber.js'; import { APIConfig } from '../../entries/apis'; import { AssetAmount } from '../../entries/crypto/asset/asset-amount'; -import { TonRecipient, TonRecipientData } from '../../entries/send'; +import { TonRecipient, TonRecipientData, TransferEstimationEvent } from '../../entries/send'; import { TonConnectTransactionPayload } from '../../entries/tonConnect'; import { WalletState } from '../../entries/wallet'; -import { - Account, - AccountsApi, - BlockchainApi, - EmulationApi, - MessageConsequences -} from '../../tonApiV2'; +import { Account, AccountsApi, BlockchainApi, EmulationApi } from '../../tonApiV2'; import { walletContractFromState } from '../wallet/contractService'; import { SendMode, @@ -30,7 +24,7 @@ export type AccountsMap = Map; export type EstimateData = { accounts: AccountsMap; - accountEvent: MessageConsequences; + accountEvent: TransferEstimationEvent; }; export const getAccountsMap = async ( @@ -159,11 +153,11 @@ export const estimateTonTransfer = async ( const cell = createTonTransfer(seqno, walletState, recipient, weiAmount, isMax); - const emulation = await new EmulationApi(api.tonApiV2).emulateMessageToWallet({ - emulateMessageToWalletRequest: { boc: cell.toString('base64') } + const event = await new EmulationApi(api.tonApiV2).emulateMessageToAccountEvent({ + accountId: wallet.address, + decodeMessageRequest: { boc: cell.toString('base64') } }); - - return emulation; + return { event }; }; export const estimateTonConnectTransfer = async ( @@ -171,16 +165,19 @@ export const estimateTonConnectTransfer = async ( walletState: WalletState, accounts: AccountsMap, params: TonConnectTransactionPayload -) => { +): Promise => { await checkServiceTimeOrDie(api); const [wallet, seqno] = await getWalletBalance(api, walletState); checkWalletPositiveBalanceOrDie(wallet); const cell = createTonConnectTransfer(seqno, walletState, accounts, params); - return await new EmulationApi(api.tonApiV2).emulateMessageToWallet({ - emulateMessageToWalletRequest: { boc: cell.toString('base64') } + const event = await new EmulationApi(api.tonApiV2).emulateMessageToAccountEvent({ + accountId: wallet.address, + decodeMessageRequest: { boc: cell.toString('base64') } }); + + return { event }; }; export const sendTonConnectTransfer = async ( @@ -217,7 +214,7 @@ export const sendTonTransfer = async ( recipient: TonRecipientData, amount: AssetAmount, isMax: boolean, - fee: MessageConsequences, + fee: TransferEstimationEvent, mnemonic: string[] ) => { await checkServiceTimeOrDie(api); diff --git a/packages/uikit/src/components/activity/NotificationCommon.tsx b/packages/uikit/src/components/activity/NotificationCommon.tsx index 12d10cf43..5ed651cf9 100644 --- a/packages/uikit/src/components/activity/NotificationCommon.tsx +++ b/packages/uikit/src/components/activity/NotificationCommon.tsx @@ -2,16 +2,16 @@ import { CryptoCurrency } from '@tonkeeper/core/dist/entries/crypto'; import { AssetAmount } from '@tonkeeper/core/dist/entries/crypto/asset/asset-amount'; import { intlLocale } from '@tonkeeper/core/dist/entries/language'; import { Network } from '@tonkeeper/core/dist/entries/network'; +import { TransferEstimationEvent } from '@tonkeeper/core/dist/entries/send'; import { AccountAddress, AccountEvent, - JettonSwapActionDexEnum, - MessageConsequences + JettonSwapActionDexEnum } from '@tonkeeper/core/dist/tonApiV2'; import { TronEvent, TronFee } from '@tonkeeper/core/dist/tronApi'; import { formatDecimals } from '@tonkeeper/core/dist/utils/balance'; import { formatAddress, toShortValue } from '@tonkeeper/core/dist/utils/common'; -import React, { FC, PropsWithChildren, useMemo } from 'react'; +import { FC, PropsWithChildren, useMemo } from 'react'; import styled from 'styled-components'; import { useAppContext, useWalletContext } from '../../hooks/appContext'; import { useAppSdk } from '../../hooks/appSdk'; @@ -283,7 +283,7 @@ export const ActionDeployerDetails: FC<{ deployer: string }> = ({ deployer }) => }; export const ActionFeeDetails: FC<{ - fee: MessageConsequences; + fee: TransferEstimationEvent; }> = ({ fee }) => { const { t } = useTranslation(); diff --git a/packages/uikit/src/components/nft/LinkNft.tsx b/packages/uikit/src/components/nft/LinkNft.tsx index dd2c287c9..0882d9397 100644 --- a/packages/uikit/src/components/nft/LinkNft.tsx +++ b/packages/uikit/src/components/nft/LinkNft.tsx @@ -2,9 +2,9 @@ import { Address } from '@ton/core'; import { AssetAmount } from '@tonkeeper/core/dist/entries/crypto/asset/asset-amount'; import { TON_ASSET } from '@tonkeeper/core/dist/entries/crypto/asset/constants'; import { NFTDNS } from '@tonkeeper/core/dist/entries/nft'; +import { TransferEstimationEvent } from '@tonkeeper/core/dist/entries/send'; import { WalletAddress } from '@tonkeeper/core/dist/entries/wallet'; import { getWalletsAddresses } from '@tonkeeper/core/dist/service/walletService'; -import { MessageConsequences } from '@tonkeeper/core/dist/tonApiV2'; import { unShiftedDecimals } from '@tonkeeper/core/dist/utils/balance'; import { areEqAddresses, formatAddress, toShortValue } from '@tonkeeper/core/dist/utils/common'; import { isTMEDomain } from '@tonkeeper/core/dist/utils/nft'; @@ -139,7 +139,7 @@ const LinkNftUnlinked: FC<{ nftAddress: nft.address, amount: unShiftedDecimals(dnsLinkAmount), linkToAddress, - fee: estimation.data?.payload as MessageConsequences + fee: estimation.data?.payload as TransferEstimationEvent }); const isSelectedCurrentAddress = areEqAddresses(linkToAddress, walletState.active.rawAddress); @@ -334,7 +334,7 @@ const LinkNftLinked: FC<{ nftAddress: nft.address, amount: unShiftedDecimals(dnsLinkAmount), linkToAddress, - fee: estimation.data?.payload as MessageConsequences + fee: estimation.data?.payload as TransferEstimationEvent }); const child = () => ( diff --git a/packages/uikit/src/components/nft/RenewNft.tsx b/packages/uikit/src/components/nft/RenewNft.tsx index 37c62f79a..4d5a61603 100644 --- a/packages/uikit/src/components/nft/RenewNft.tsx +++ b/packages/uikit/src/components/nft/RenewNft.tsx @@ -2,10 +2,10 @@ import { AssetAmount } from '@tonkeeper/core/dist/entries/crypto/asset/asset-amo import { TON_ASSET } from '@tonkeeper/core/dist/entries/crypto/asset/constants'; import { intlLocale } from '@tonkeeper/core/dist/entries/language'; import { NFTDNS } from '@tonkeeper/core/dist/entries/nft'; -import { MessageConsequences } from '@tonkeeper/core/dist/tonApiV2'; +import { TransferEstimationEvent } from '@tonkeeper/core/dist/entries/send'; import { unShiftedDecimals } from '@tonkeeper/core/dist/utils/balance'; import BigNumber from 'bignumber.js'; -import React, { FC, useEffect, useState } from 'react'; +import { FC, useEffect, useState } from 'react'; import styled from 'styled-components'; import { useToast } from '../../hooks/appSdk'; import { useAreNftActionsDisabled } from '../../hooks/blockchain/nft/useAreNftActionsDisabled'; @@ -96,7 +96,7 @@ export const RenewNft: FC<{ const mutation = useRenewNft({ nftAddress: nft.address, amount: unShiftedDecimals(dnsRenewAmount), - fee: estimation.data?.payload as MessageConsequences + fee: estimation.data?.payload as TransferEstimationEvent }); const onOpen = () => { diff --git a/packages/uikit/src/components/transfer/nft/ConfirmNftView.tsx b/packages/uikit/src/components/transfer/nft/ConfirmNftView.tsx index 5e3758e29..b1a2bae0a 100644 --- a/packages/uikit/src/components/transfer/nft/ConfirmNftView.tsx +++ b/packages/uikit/src/components/transfer/nft/ConfirmNftView.tsx @@ -16,8 +16,11 @@ import { notifyError } from '../common'; import { AssetAmount } from '@tonkeeper/core/dist/entries/crypto/asset/asset-amount'; import { TON_ASSET } from '@tonkeeper/core/dist/entries/crypto/asset/constants'; import { TonAsset } from '@tonkeeper/core/dist/entries/crypto/asset/ton-asset'; -import { TonRecipientData, TransferEstimation } from '@tonkeeper/core/dist/entries/send'; -import { MessageConsequences } from '@tonkeeper/core/dist/tonApiV2'; +import { + TonRecipientData, + TransferEstimation, + TransferEstimationEvent +} from '@tonkeeper/core/dist/entries/send'; import { useTransactionAnalytics } from '../../../hooks/amplitude'; import { QueryKey } from '../../../libs/queryKey'; import { getMnemonic } from '../../../state/mnemonic'; @@ -61,7 +64,11 @@ const useNftTransferEstimation = (nftItem: NftItem, data?: TonRecipientData) => ); }; -const useSendNft = (recipient: TonRecipientData, nftItem: NftItem, fee?: MessageConsequences) => { +const useSendNft = ( + recipient: TonRecipientData, + nftItem: NftItem, + fee?: TransferEstimationEvent +) => { const { t } = useTranslation(); const sdk = useAppSdk(); const { api } = useAppContext(); diff --git a/packages/uikit/src/hooks/blockchain/nft/useLinkNft.ts b/packages/uikit/src/hooks/blockchain/nft/useLinkNft.ts index 8f254190c..91f262ef4 100644 --- a/packages/uikit/src/hooks/blockchain/nft/useLinkNft.ts +++ b/packages/uikit/src/hooks/blockchain/nft/useLinkNft.ts @@ -1,5 +1,5 @@ +import { TransferEstimationEvent } from '@tonkeeper/core/dist/entries/send'; import { sendNftLink } from '@tonkeeper/core/dist/service/transfer/nftService'; -import { MessageConsequences } from '@tonkeeper/core/dist/tonApiV2'; import BigNumber from 'bignumber.js'; import { useExecuteTonContract } from '../useExecuteTonContract'; @@ -7,5 +7,5 @@ export const useLinkNft = (args: { nftAddress: string; linkToAddress: string; amount: BigNumber; - fee: MessageConsequences; + fee: TransferEstimationEvent; }) => useExecuteTonContract({ executor: sendNftLink, eventName2: 'link-dns' }, args); diff --git a/packages/uikit/src/hooks/blockchain/nft/useRenewNft.ts b/packages/uikit/src/hooks/blockchain/nft/useRenewNft.ts index 591ce1f3f..495ec5f99 100644 --- a/packages/uikit/src/hooks/blockchain/nft/useRenewNft.ts +++ b/packages/uikit/src/hooks/blockchain/nft/useRenewNft.ts @@ -1,10 +1,10 @@ +import { TransferEstimationEvent } from '@tonkeeper/core/dist/entries/send'; import { sendNftRenew } from '@tonkeeper/core/dist/service/transfer/nftService'; -import { MessageConsequences } from '@tonkeeper/core/dist/tonApiV2'; import BigNumber from 'bignumber.js'; import { useExecuteTonContract } from '../useExecuteTonContract'; export const useRenewNft = (args: { nftAddress: string; amount: BigNumber; - fee: MessageConsequences; + fee: TransferEstimationEvent; }) => useExecuteTonContract({ executor: sendNftRenew, eventName2: 'renew-dns' }, args); diff --git a/packages/uikit/src/hooks/blockchain/useEstimateTonFee.ts b/packages/uikit/src/hooks/blockchain/useEstimateTonFee.ts index 76493094b..a919d5957 100644 --- a/packages/uikit/src/hooks/blockchain/useEstimateTonFee.ts +++ b/packages/uikit/src/hooks/blockchain/useEstimateTonFee.ts @@ -34,15 +34,16 @@ export function useEstimateTonFee( async () => { const boc = await caller({ ...args, walletState, api } as Args); - const emulation = await new EmulationApi(api.tonApiV2).emulateMessageToWallet({ - emulateMessageToWalletRequest: { boc } + const event = await new EmulationApi(api.tonApiV2).emulateMessageToAccountEvent({ + accountId: walletState.active.rawAddress, + decodeMessageRequest: { boc } }); const fee = new AssetAmount({ asset: TON_ASSET, - weiAmount: emulation.event.extra * -1 + weiAmount: event.extra * -1 }); - return { fee, payload: emulation }; + return { fee, payload: { event } }; }, // eslint-disable-next-line @typescript-eslint/no-explicit-any options as any diff --git a/packages/uikit/src/hooks/blockchain/useEstimateTransfer.ts b/packages/uikit/src/hooks/blockchain/useEstimateTransfer.ts index 47d1b00d5..23964ca1f 100644 --- a/packages/uikit/src/hooks/blockchain/useEstimateTransfer.ts +++ b/packages/uikit/src/hooks/blockchain/useEstimateTransfer.ts @@ -9,13 +9,14 @@ import { TronAsset } from '@tonkeeper/core/dist/entries/crypto/asset/tron-asset' import { RecipientData, TonRecipientData, - TransferEstimation + TransferEstimation, + TransferEstimationEvent } from '@tonkeeper/core/dist/entries/send'; import { WalletState } from '@tonkeeper/core/dist/entries/wallet'; import { estimateJettonTransfer } from '@tonkeeper/core/dist/service/transfer/jettonService'; import { estimateTonTransfer } from '@tonkeeper/core/dist/service/transfer/tonService'; import { estimateTron } from '@tonkeeper/core/dist/service/tron/tronTransferService'; -import { JettonsBalances, MessageConsequences } from '@tonkeeper/core/dist/tonApiV2'; +import { JettonsBalances } from '@tonkeeper/core/dist/tonApiV2'; import { notifyError } from '../../components/transfer/common'; import { QueryKey } from '../../libs/queryKey'; import { DefaultRefetchInterval } from '../../state/tonendpoint'; @@ -40,7 +41,7 @@ async function estimateTon({ wallet: WalletState; jettons: JettonsBalances | undefined; }): Promise> { - let payload: MessageConsequences; + let payload: TransferEstimationEvent; if (amount.asset.id === TON_ASSET.id) { payload = await estimateTonTransfer( api, diff --git a/packages/uikit/src/hooks/blockchain/useExecuteTonContract.ts b/packages/uikit/src/hooks/blockchain/useExecuteTonContract.ts index 03211456e..ebda1be18 100644 --- a/packages/uikit/src/hooks/blockchain/useExecuteTonContract.ts +++ b/packages/uikit/src/hooks/blockchain/useExecuteTonContract.ts @@ -1,7 +1,7 @@ import { useMutation, useQueryClient } from '@tanstack/react-query'; import { APIConfig } from '@tonkeeper/core/dist/entries/apis'; +import { TransferEstimationEvent } from '@tonkeeper/core/dist/entries/send'; import { WalletState } from '@tonkeeper/core/dist/entries/wallet'; -import { MessageConsequences } from '@tonkeeper/core/dist/tonApiV2'; import { Omit } from 'react-beautiful-dnd'; import { notifyError } from '../../components/transfer/common'; import { getMnemonic } from '../../state/mnemonic'; @@ -14,7 +14,7 @@ export type ContractExecutorParams = { api: APIConfig; walletState: WalletState; mnemonic: string[]; - fee: MessageConsequences; + fee: TransferEstimationEvent; }; export function useExecuteTonContract( diff --git a/packages/uikit/src/hooks/blockchain/useSendTransfer.ts b/packages/uikit/src/hooks/blockchain/useSendTransfer.ts index 437070506..b18e602dc 100644 --- a/packages/uikit/src/hooks/blockchain/useSendTransfer.ts +++ b/packages/uikit/src/hooks/blockchain/useSendTransfer.ts @@ -7,12 +7,12 @@ import { TonAsset } from '@tonkeeper/core/dist/entries/crypto/asset/ton-asset'; import { TonRecipientData, TransferEstimation, + TransferEstimationEvent, TronRecipientData } from '@tonkeeper/core/dist/entries/send'; import { sendJettonTransfer } from '@tonkeeper/core/dist/service/transfer/jettonService'; import { sendTonTransfer } from '@tonkeeper/core/dist/service/transfer/tonService'; import { sendTronTransfer } from '@tonkeeper/core/dist/service/tron/tronTransferService'; -import { MessageConsequences } from '@tonkeeper/core/dist/tonApiV2'; import { EstimatePayload } from '@tonkeeper/core/dist/tronApi'; import { notifyError } from '../../components/transfer/common'; import { getMnemonic } from '../../state/mnemonic'; @@ -49,7 +49,7 @@ export function useSendTransfer( recipient as TonRecipientData, amount, isMax, - estimation.payload as MessageConsequences, + estimation.payload as TransferEstimationEvent, mnemonic ); } else { @@ -65,7 +65,7 @@ export function useSendTransfer( recipient as TonRecipientData, amount as AssetAmount, jettonInfo!.walletAddress.address, - estimation.payload as MessageConsequences, + estimation.payload as TransferEstimationEvent, mnemonic ); } From df644d13539ef43c8537e7d040f540533d8ed7c7 Mon Sep 17 00:00:00 2001 From: Nikita Kuznetsov Date: Mon, 18 Mar 2024 18:20:04 +0100 Subject: [PATCH 04/10] Update wallet code --- packages/core/package.json | 2 +- packages/core/src/service/wallet/contractService.ts | 1 - yarn.lock | 8 ++++---- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/packages/core/package.json b/packages/core/package.json index 36156364b..16e85862f 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -21,7 +21,7 @@ "dependencies": { "@ton/core": "0.54.0", "@ton/crypto": "3.2.0", - "@ton/ton": "https://github.com/tonkeeper/tonkeeper-ton#build4", + "@ton/ton": "https://github.com/tonkeeper/tonkeeper-ton#build5", "bignumber.js": "^9.1.1", "ethers": "^6.6.5", "query-string": "^8.1.0", diff --git a/packages/core/src/service/wallet/contractService.ts b/packages/core/src/service/wallet/contractService.ts index b7932e89d..3b24dd4df 100644 --- a/packages/core/src/service/wallet/contractService.ts +++ b/packages/core/src/service/wallet/contractService.ts @@ -30,7 +30,6 @@ export const walletContract = ( case WalletVersion.W5: return WalletContractV5.create({ walletId: { - workChain: workchain, networkGlobalId: network }, publicKey diff --git a/yarn.lock b/yarn.lock index 052cc582c..b120dfda7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6064,9 +6064,9 @@ __metadata: languageName: node linkType: hard -"@ton/ton@https://github.com/tonkeeper/tonkeeper-ton#build4": +"@ton/ton@https://github.com/tonkeeper/tonkeeper-ton#build5": version: 13.9.0 - resolution: "@ton/ton@https://github.com/tonkeeper/tonkeeper-ton.git#commit=305a0cbf1f498c2ab03f70e3b547379195adcbbd" + resolution: "@ton/ton@https://github.com/tonkeeper/tonkeeper-ton.git#commit=97451d09801c5e5680958d146c8025c3793c5f26" dependencies: axios: "npm:^0.25.0" dataloader: "npm:^2.0.0" @@ -6076,7 +6076,7 @@ __metadata: peerDependencies: "@ton/core": ">=0.53.0" "@ton/crypto": ">=3.2.0" - checksum: 574826c6f85ee20471dbbad5fc32c82b869983eb9eb7bf9a2b1682b8d17f6f55b2e74ea41608f7dbc1dc1d08177f158c6813ec7cb37ccfc2d48f0968f16e0a4a + checksum: 39ca8e1f2e756ce41af112c70a6252b4b4b84435e6dc5f4112e67c37cfcce9d0e1d2244657b4fabe5b8a8b2dbca4d37201c5f771a531682b0225a8241c27b564 languageName: node linkType: hard @@ -6086,7 +6086,7 @@ __metadata: dependencies: "@ton/core": "npm:0.54.0" "@ton/crypto": "npm:3.2.0" - "@ton/ton": "https://github.com/tonkeeper/tonkeeper-ton#build4" + "@ton/ton": "https://github.com/tonkeeper/tonkeeper-ton#build5" bignumber.js: "npm:^9.1.1" ethers: "npm:^6.6.5" npm-run-all: "npm:^4.1.5" From 70dd4acfd2e0066e37489a769fc0cc90c089e837 Mon Sep 17 00:00:00 2001 From: Nikita Kuznetsov Date: Mon, 18 Mar 2024 18:29:15 +0100 Subject: [PATCH 05/10] Hide setting --- packages/uikit/src/pages/settings/Dev.tsx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/uikit/src/pages/settings/Dev.tsx b/packages/uikit/src/pages/settings/Dev.tsx index 8d21e2aa3..a44b1ec48 100644 --- a/packages/uikit/src/pages/settings/Dev.tsx +++ b/packages/uikit/src/pages/settings/Dev.tsx @@ -3,16 +3,17 @@ import React, { useMemo } from 'react'; import { InnerBody } from '../../components/Body'; import { SubHeader } from '../../components/SubHeader'; import { SettingsItem, SettingsList } from '../../components/settings/SettingsList'; -import { useWalletContext } from '../../hooks/appContext'; +import { useAppContext, useWalletContext } from '../../hooks/appContext'; import { useTranslation } from '../../hooks/translation'; import { useEnableW5, useEnableW5Mutation } from '../../state/experemental'; import { useMutateWalletProperty } from '../../state/wallet'; const SettingsW5 = () => { + const { experimental } = useAppContext(); const { data } = useEnableW5(); const { mutate } = useEnableW5Mutation(); - const experimental = useMemo(() => { + const items = useMemo(() => { return [ { name: 'Experimental W5', @@ -22,9 +23,9 @@ const SettingsW5 = () => { ]; }, [data, mutate]); - if (data === undefined) return null; + if (data === undefined || experimental !== true) return null; - return ; + return ; }; export const DevSettings = React.memo(() => { From b8817b42579d46ff3c724de50db0b4213f89f25a Mon Sep 17 00:00:00 2001 From: Nikita Kuznetsov Date: Fri, 22 Mar 2024 13:16:37 +0100 Subject: [PATCH 06/10] WIP --- packages/core/src/entries/network.ts | 2 +- .../src/service/transfer/jettonService.ts | 1 + .../core/src/service/transfer/nftService.ts | 1 + .../core/src/service/transfer/tonService.ts | 3 + .../src/tonApiV2/.openapi-generator/FILES | 4 +- .../src/tonApiV2/.openapi-generator/VERSION | 2 +- .../core/src/tonApiV2/apis/AccountsApi.ts | 319 +++++++++++------- .../core/src/tonApiV2/apis/BlockchainApi.ts | 197 ++++++++--- packages/core/src/tonApiV2/apis/ConnectApi.ts | 15 +- packages/core/src/tonApiV2/apis/DNSApi.ts | 37 +- .../core/src/tonApiV2/apis/EmulationApi.ts | 86 +++-- packages/core/src/tonApiV2/apis/EventsApi.ts | 19 +- .../core/src/tonApiV2/apis/InscriptionsApi.ts | 135 +++++--- packages/core/src/tonApiV2/apis/JettonsApi.ts | 53 +-- .../core/src/tonApiV2/apis/LiteServerApi.ts | 264 +++++++++------ packages/core/src/tonApiV2/apis/NFTApi.ts | 123 ++++--- packages/core/src/tonApiV2/apis/RatesApi.ts | 65 ++-- packages/core/src/tonApiV2/apis/StakingApi.ts | 49 +-- packages/core/src/tonApiV2/apis/StorageApi.ts | 6 +- packages/core/src/tonApiV2/apis/TracesApi.ts | 15 +- packages/core/src/tonApiV2/apis/WalletApi.ts | 64 ++-- packages/core/src/tonApiV2/models/Account.ts | 76 +++-- .../src/tonApiV2/models/AccountAddress.ts | 35 +- .../core/src/tonApiV2/models/AccountEvent.ts | 47 ++- .../core/src/tonApiV2/models/AccountEvents.ts | 23 +- .../tonApiV2/models/AccountInfoByStateInit.ts | 23 +- .../src/tonApiV2/models/AccountStaking.ts | 19 +- .../src/tonApiV2/models/AccountStakingInfo.ts | 35 +- .../src/tonApiV2/models/AccountStorageInfo.ts | 35 +- packages/core/src/tonApiV2/models/Accounts.ts | 19 +- packages/core/src/tonApiV2/models/Action.ts | 107 +++--- .../core/src/tonApiV2/models/ActionPhase.ts | 39 +-- .../tonApiV2/models/ActionSimplePreview.ts | 39 +-- .../models/AddressParse200Response.ts | 35 +- .../AddressParse200ResponseBounceable.ts | 23 +- .../core/src/tonApiV2/models/ApyHistory.ts | 23 +- packages/core/src/tonApiV2/models/Auction.ts | 35 +- .../src/tonApiV2/models/AuctionBidAction.ts | 35 +- packages/core/src/tonApiV2/models/Auctions.ts | 23 +- .../models/BlockCurrencyCollection.ts | 23 +- .../BlockCurrencyCollectionOtherInner.ts | 23 +- .../core/src/tonApiV2/models/BlockLimits.ts | 27 +- .../src/tonApiV2/models/BlockParamLimits.ts | 27 +- packages/core/src/tonApiV2/models/BlockRaw.ts | 39 +-- .../src/tonApiV2/models/BlockValueFlow.ts | 55 ++- .../models/BlockchainAccountInspect.ts | 31 +- .../BlockchainAccountInspectMethodsInner.ts | 23 +- .../src/tonApiV2/models/BlockchainBlock.ts | 135 ++++---- .../tonApiV2/models/BlockchainBlockShards.ts | 19 +- .../BlockchainBlockShardsShardsInner.ts | 19 +- .../src/tonApiV2/models/BlockchainBlocks.ts | 19 +- .../src/tonApiV2/models/BlockchainConfig.ts | 191 +++++------ .../src/tonApiV2/models/BlockchainConfig10.ts | 19 +- .../src/tonApiV2/models/BlockchainConfig11.ts | 23 +- .../src/tonApiV2/models/BlockchainConfig12.ts | 19 +- .../src/tonApiV2/models/BlockchainConfig13.ts | 27 +- .../src/tonApiV2/models/BlockchainConfig14.ts | 23 +- .../src/tonApiV2/models/BlockchainConfig15.ts | 31 +- .../src/tonApiV2/models/BlockchainConfig16.ts | 27 +- .../src/tonApiV2/models/BlockchainConfig17.ts | 31 +- .../src/tonApiV2/models/BlockchainConfig18.ts | 19 +- .../BlockchainConfig18StoragePricesInner.ts | 35 +- .../src/tonApiV2/models/BlockchainConfig20.ts | 19 +- .../src/tonApiV2/models/BlockchainConfig21.ts | 19 +- .../src/tonApiV2/models/BlockchainConfig22.ts | 19 +- .../src/tonApiV2/models/BlockchainConfig23.ts | 19 +- .../src/tonApiV2/models/BlockchainConfig24.ts | 19 +- .../src/tonApiV2/models/BlockchainConfig25.ts | 19 +- .../src/tonApiV2/models/BlockchainConfig28.ts | 39 +-- .../src/tonApiV2/models/BlockchainConfig29.ts | 63 ++-- .../src/tonApiV2/models/BlockchainConfig31.ts | 19 +- .../src/tonApiV2/models/BlockchainConfig40.ts | 19 +- .../src/tonApiV2/models/BlockchainConfig43.ts | 19 +- .../src/tonApiV2/models/BlockchainConfig44.ts | 23 +- .../src/tonApiV2/models/BlockchainConfig5.ts | 27 +- .../src/tonApiV2/models/BlockchainConfig6.ts | 23 +- .../src/tonApiV2/models/BlockchainConfig7.ts | 19 +- .../src/tonApiV2/models/BlockchainConfig71.ts | 19 +- .../src/tonApiV2/models/BlockchainConfig79.ts | 19 +- .../BlockchainConfig7CurrenciesInner.ts | 23 +- .../src/tonApiV2/models/BlockchainConfig8.ts | 23 +- .../src/tonApiV2/models/BlockchainConfig9.ts | 19 +- .../tonApiV2/models/BlockchainRawAccount.ts | 87 +++-- .../BlockchainRawAccountLibrariesInner.ts | 70 ++++ .../core/src/tonApiV2/models/ComputePhase.ts | 43 ++- .../tonApiV2/models/ConfigProposalSetup.ts | 47 ++- .../tonApiV2/models/ContractDeployAction.ts | 23 +- .../core/src/tonApiV2/models/CreditPhase.ts | 23 +- .../tonApiV2/models/DecodeMessageRequest.ts | 19 +- .../src/tonApiV2/models/DecodedMessage.ts | 27 +- .../models/DecodedMessageExtInMsgDecoded.ts | 27 +- ...dMessageExtInMsgDecodedWalletHighloadV2.ts | 27 +- .../DecodedMessageExtInMsgDecodedWalletV3.ts | 31 +- .../DecodedMessageExtInMsgDecodedWalletV4.ts | 35 +- .../src/tonApiV2/models/DecodedRawMessage.ts | 23 +- .../models/DecodedRawMessageMessage.ts | 33 +- .../src/tonApiV2/models/DepositStakeAction.ts | 31 +- .../core/src/tonApiV2/models/DnsExpiring.ts | 19 +- .../tonApiV2/models/DnsExpiringItemsInner.ts | 27 +- .../core/src/tonApiV2/models/DnsRecord.ts | 31 +- .../core/src/tonApiV2/models/DomainBid.ts | 35 +- .../core/src/tonApiV2/models/DomainBids.ts | 19 +- .../core/src/tonApiV2/models/DomainInfo.ts | 27 +- .../core/src/tonApiV2/models/DomainNames.ts | 19 +- .../src/tonApiV2/models/DomainRenewAction.ts | 27 +- .../models/ElectionsDepositStakeAction.ts | 23 +- .../models/ElectionsRecoverStakeAction.ts | 23 +- .../models/EmulateMessageToWalletRequest.ts | 23 +- ...mulateMessageToWalletRequestParamsInner.ts | 23 +- .../src/tonApiV2/models/EncryptedComment.ts | 23 +- packages/core/src/tonApiV2/models/Event.ts | 43 ++- .../core/src/tonApiV2/models/FoundAccounts.ts | 19 +- .../models/FoundAccountsAddressesInner.ts | 27 +- .../src/tonApiV2/models/GasLimitPrices.ts | 51 ++- .../models/GetAccountDiff200Response.ts | 19 +- .../GetAccountInfoByStateInitRequest.ts | 19 +- .../models/GetAccountPublicKey200Response.ts | 19 +- .../src/tonApiV2/models/GetAccountsRequest.ts | 19 +- .../models/GetAllRawShardsInfo200Response.ts | 27 +- .../GetBlockchainBlockDefaultResponse.ts | 66 ---- .../models/GetChartRates200Response.ts | 19 +- .../GetInscriptionOpTemplate200Response.ts | 23 +- .../tonApiV2/models/GetRates200Response.ts | 19 +- .../models/GetRawAccountState200Response.ts | 35 +- .../models/GetRawBlockProof200Response.ts | 31 +- .../GetRawBlockProof200ResponseStepsInner.ts | 23 +- ...sponseStepsInnerLiteServerBlockLinkBack.ts | 39 +-- ...nseStepsInnerLiteServerBlockLinkForward.ts | 39 +-- ...nerLiteServerBlockLinkForwardSignatures.ts | 27 +- ...ockLinkForwardSignaturesSignaturesInner.ts | 23 +- .../GetRawBlockchainBlock200Response.ts | 23 +- .../GetRawBlockchainBlockHeader200Response.ts | 27 +- .../GetRawBlockchainBlockState200Response.ts | 31 +- .../models/GetRawConfig200Response.ts | 31 +- .../GetRawListBlockTransactions200Response.ts | 35 +- ...istBlockTransactions200ResponseIdsInner.ts | 31 +- .../GetRawMasterchainInfo200Response.ts | 27 +- .../GetRawMasterchainInfoExt200Response.ts | 47 ++- .../GetRawShardBlockProof200Response.ts | 23 +- ...RawShardBlockProof200ResponseLinksInner.ts | 23 +- .../models/GetRawShardInfo200Response.ts | 31 +- .../tonApiV2/models/GetRawTime200Response.ts | 19 +- .../models/GetRawTransactions200Response.ts | 23 +- .../GetStakingPoolHistory200Response.ts | 19 +- .../models/GetStakingPoolInfo200Response.ts | 23 +- .../models/GetStakingPools200Response.ts | 23 +- .../models/GetStorageProviders200Response.ts | 19 +- .../models/GetTonConnectPayload200Response.ts | 19 +- .../models/GetWalletBackup200Response.ts | 19 +- .../core/src/tonApiV2/models/ImagePreview.ts | 23 +- .../core/src/tonApiV2/models/InitStateRaw.ts | 27 +- .../src/tonApiV2/models/InscriptionBalance.ts | 31 +- .../tonApiV2/models/InscriptionBalances.ts | 19 +- .../tonApiV2/models/InscriptionMintAction.ts | 35 +- .../models/InscriptionTransferAction.ts | 43 ++- .../core/src/tonApiV2/models/JettonBalance.ts | 31 +- .../src/tonApiV2/models/JettonBridgeParams.ts | 43 ++- .../src/tonApiV2/models/JettonBridgePrices.ts | 39 +-- .../src/tonApiV2/models/JettonBurnAction.ts | 31 +- .../core/src/tonApiV2/models/JettonHolders.ts | 19 +- .../models/JettonHoldersAddressesInner.ts | 27 +- .../core/src/tonApiV2/models/JettonInfo.ts | 35 +- .../src/tonApiV2/models/JettonMetadata.ts | 51 ++- .../src/tonApiV2/models/JettonMintAction.ts | 31 +- .../core/src/tonApiV2/models/JettonPreview.ts | 39 +-- .../src/tonApiV2/models/JettonQuantity.ts | 27 +- .../src/tonApiV2/models/JettonSwapAction.ts | 51 ++- .../tonApiV2/models/JettonTransferAction.ts | 51 ++- packages/core/src/tonApiV2/models/Jettons.ts | 19 +- .../src/tonApiV2/models/JettonsBalances.ts | 19 +- packages/core/src/tonApiV2/models/Message.ts | 85 +++-- .../tonApiV2/models/MessageConsequences.ts | 27 +- .../tonApiV2/models/MethodExecutionResult.ts | 33 +- .../models/MisbehaviourPunishmentConfig.ts | 59 ++-- .../core/src/tonApiV2/models/ModelError.ts | 19 +- .../src/tonApiV2/models/MsgForwardPrices.ts | 39 +-- .../core/src/tonApiV2/models/NftCollection.ts | 43 ++- .../src/tonApiV2/models/NftCollections.ts | 19 +- packages/core/src/tonApiV2/models/NftItem.ts | 55 ++- .../src/tonApiV2/models/NftItemCollection.ts | 27 +- .../tonApiV2/models/NftItemTransferAction.ts | 43 ++- packages/core/src/tonApiV2/models/NftItems.ts | 19 +- .../src/tonApiV2/models/NftPurchaseAction.ts | 40 +-- packages/core/src/tonApiV2/models/Oracle.ts | 23 +- .../src/tonApiV2/models/OracleBridgeParams.ts | 31 +- .../src/tonApiV2/models/PoolImplementation.ts | 31 +- packages/core/src/tonApiV2/models/PoolInfo.ts | 75 ++-- packages/core/src/tonApiV2/models/Price.ts | 23 +- .../tonApiV2/models/RawBlockchainConfig.ts | 19 +- .../ReduceIndexingLatencyDefaultResponse.ts | 61 ++++ packages/core/src/tonApiV2/models/Refund.ts | 23 +- packages/core/src/tonApiV2/models/Risk.ts | 31 +- packages/core/src/tonApiV2/models/Sale.ts | 31 +- .../models/SendBlockchainMessageRequest.ts | 23 +- .../models/SendRawMessage200Response.ts | 19 +- .../tonApiV2/models/SendRawMessageRequest.ts | 19 +- packages/core/src/tonApiV2/models/Seqno.ts | 19 +- .../core/src/tonApiV2/models/ServiceStatus.ts | 70 ++++ .../src/tonApiV2/models/SizeLimitsConfig.ts | 47 ++- .../tonApiV2/models/SmartContractAction.ts | 39 +-- .../core/src/tonApiV2/models/StateInit.ts | 19 +- .../core/src/tonApiV2/models/StoragePhase.ts | 27 +- .../src/tonApiV2/models/StorageProvider.ts | 39 +-- .../core/src/tonApiV2/models/Subscription.ts | 59 ++-- .../src/tonApiV2/models/SubscriptionAction.ts | 35 +- .../core/src/tonApiV2/models/Subscriptions.ts | 19 +- .../core/src/tonApiV2/models/TokenRates.ts | 31 +- .../models/TonConnectProof200Response.ts | 19 +- .../tonApiV2/models/TonConnectProofRequest.ts | 23 +- .../models/TonConnectProofRequestProof.ts | 35 +- .../TonConnectProofRequestProofDomain.ts | 23 +- .../src/tonApiV2/models/TonTransferAction.ts | 39 +-- packages/core/src/tonApiV2/models/Trace.ts | 31 +- packages/core/src/tonApiV2/models/TraceID.ts | 23 +- packages/core/src/tonApiV2/models/TraceIDs.ts | 19 +- .../core/src/tonApiV2/models/Transaction.ts | 107 +++--- .../core/src/tonApiV2/models/Transactions.ts | 19 +- .../src/tonApiV2/models/TvmStackRecord.ts | 35 +- .../tonApiV2/models/UnSubscriptionAction.ts | 27 +- .../core/src/tonApiV2/models/Validator.ts | 31 +- .../core/src/tonApiV2/models/Validators.ts | 35 +- .../core/src/tonApiV2/models/ValidatorsSet.ts | 39 +-- .../tonApiV2/models/ValidatorsSetListInner.ts | 27 +- .../core/src/tonApiV2/models/ValueFlow.ts | 31 +- .../tonApiV2/models/ValueFlowJettonsInner.ts | 27 +- .../core/src/tonApiV2/models/WalletDNS.ts | 35 +- .../tonApiV2/models/WithdrawStakeAction.ts | 31 +- .../models/WithdrawStakeRequestAction.ts | 31 +- .../src/tonApiV2/models/WorkchainDescr.ts | 63 ++-- packages/core/src/tonApiV2/models/index.ts | 4 +- packages/core/src/tonApiV2/runtime.ts | 9 +- .../src/hooks/blockchain/useEstimateTonFee.ts | 1 + packages/uikit/src/state/rates.ts | 8 +- packages/uikit/src/state/wallet.ts | 2 +- 234 files changed, 3874 insertions(+), 4341 deletions(-) create mode 100644 packages/core/src/tonApiV2/models/BlockchainRawAccountLibrariesInner.ts delete mode 100644 packages/core/src/tonApiV2/models/GetBlockchainBlockDefaultResponse.ts create mode 100644 packages/core/src/tonApiV2/models/ReduceIndexingLatencyDefaultResponse.ts create mode 100644 packages/core/src/tonApiV2/models/ServiceStatus.ts diff --git a/packages/core/src/entries/network.ts b/packages/core/src/entries/network.ts index 046c2ca1c..36de36d6e 100644 --- a/packages/core/src/entries/network.ts +++ b/packages/core/src/entries/network.ts @@ -18,7 +18,7 @@ export const switchNetwork = (current: Network): Network => { export const getTonClientV2 = (config: TonendpointConfig, current?: Network) => { return new ConfigurationV2({ basePath: - current === Network.MAINNET ? 'https://keeper.tonapi.io' : 'https://testnet.tonapi.io', + current === Network.MAINNET ? 'https://dev.tonapi.io' : 'https://testnet.tonapi.io', headers: { Authorization: `Bearer ${config.tonApiV2Key}` } diff --git a/packages/core/src/service/transfer/jettonService.ts b/packages/core/src/service/transfer/jettonService.ts index 104f59847..b2808f518 100644 --- a/packages/core/src/service/transfer/jettonService.ts +++ b/packages/core/src/service/transfer/jettonService.ts @@ -102,6 +102,7 @@ export const estimateJettonTransfer = async ( ); const event = await new EmulationApi(api.tonApiV2).emulateMessageToAccountEvent({ + ignoreSignatureCheck: true, accountId: wallet.address, decodeMessageRequest: { boc: cell.toString('base64') } }); diff --git a/packages/core/src/service/transfer/nftService.ts b/packages/core/src/service/transfer/nftService.ts index 8a10aff4c..90231186a 100644 --- a/packages/core/src/service/transfer/nftService.ts +++ b/packages/core/src/service/transfer/nftService.ts @@ -106,6 +106,7 @@ export const estimateNftTransfer = async ( ); const event = await new EmulationApi(api.tonApiV2).emulateMessageToAccountEvent({ + ignoreSignatureCheck: true, accountId: wallet.address, decodeMessageRequest: { boc: cell.toString('base64') } }); diff --git a/packages/core/src/service/transfer/tonService.ts b/packages/core/src/service/transfer/tonService.ts index 18b1faaa3..0b041fd12 100644 --- a/packages/core/src/service/transfer/tonService.ts +++ b/packages/core/src/service/transfer/tonService.ts @@ -150,10 +150,12 @@ export const estimateTonTransfer = async ( if (!isMax) { checkWalletPositiveBalanceOrDie(wallet); } + console.log({ seqno }); const cell = createTonTransfer(seqno, walletState, recipient, weiAmount, isMax); const event = await new EmulationApi(api.tonApiV2).emulateMessageToAccountEvent({ + ignoreSignatureCheck: true, accountId: wallet.address, decodeMessageRequest: { boc: cell.toString('base64') } }); @@ -173,6 +175,7 @@ export const estimateTonConnectTransfer = async ( const cell = createTonConnectTransfer(seqno, walletState, accounts, params); const event = await new EmulationApi(api.tonApiV2).emulateMessageToAccountEvent({ + ignoreSignatureCheck: true, accountId: wallet.address, decodeMessageRequest: { boc: cell.toString('base64') } }); diff --git a/packages/core/src/tonApiV2/.openapi-generator/FILES b/packages/core/src/tonApiV2/.openapi-generator/FILES index a83607a85..f9da4c8ca 100644 --- a/packages/core/src/tonApiV2/.openapi-generator/FILES +++ b/packages/core/src/tonApiV2/.openapi-generator/FILES @@ -80,6 +80,7 @@ models/BlockchainConfig7CurrenciesInner.ts models/BlockchainConfig8.ts models/BlockchainConfig9.ts models/BlockchainRawAccount.ts +models/BlockchainRawAccountLibrariesInner.ts models/BouncePhaseType.ts models/ComputePhase.ts models/ComputeSkipReason.ts @@ -117,7 +118,6 @@ models/GetAccountInfoByStateInitRequest.ts models/GetAccountPublicKey200Response.ts models/GetAccountsRequest.ts models/GetAllRawShardsInfo200Response.ts -models/GetBlockchainBlockDefaultResponse.ts models/GetChartRates200Response.ts models/GetInscriptionOpTemplate200Response.ts models/GetRates200Response.ts @@ -189,6 +189,7 @@ models/PoolImplementationType.ts models/PoolInfo.ts models/Price.ts models/RawBlockchainConfig.ts +models/ReduceIndexingLatencyDefaultResponse.ts models/Refund.ts models/Risk.ts models/Sale.ts @@ -196,6 +197,7 @@ models/SendBlockchainMessageRequest.ts models/SendRawMessage200Response.ts models/SendRawMessageRequest.ts models/Seqno.ts +models/ServiceStatus.ts models/SizeLimitsConfig.ts models/SmartContractAction.ts models/StateInit.ts diff --git a/packages/core/src/tonApiV2/.openapi-generator/VERSION b/packages/core/src/tonApiV2/.openapi-generator/VERSION index fff4bdd7a..08bfd0643 100644 --- a/packages/core/src/tonApiV2/.openapi-generator/VERSION +++ b/packages/core/src/tonApiV2/.openapi-generator/VERSION @@ -1 +1 @@ -7.3.0-SNAPSHOT \ No newline at end of file +7.5.0-SNAPSHOT diff --git a/packages/core/src/tonApiV2/apis/AccountsApi.ts b/packages/core/src/tonApiV2/apis/AccountsApi.ts index 519bf24ab..5b3fa1430 100644 --- a/packages/core/src/tonApiV2/apis/AccountsApi.ts +++ b/packages/core/src/tonApiV2/apis/AccountsApi.ts @@ -26,9 +26,9 @@ import type { GetAccountDiff200Response, GetAccountPublicKey200Response, GetAccountsRequest, - GetBlockchainBlockDefaultResponse, JettonsBalances, NftItems, + ReduceIndexingLatencyDefaultResponse, Subscriptions, TraceIDs, } from '../models/index'; @@ -55,12 +55,12 @@ import { GetAccountPublicKey200ResponseToJSON, GetAccountsRequestFromJSON, GetAccountsRequestToJSON, - GetBlockchainBlockDefaultResponseFromJSON, - GetBlockchainBlockDefaultResponseToJSON, JettonsBalancesFromJSON, JettonsBalancesToJSON, NftItemsFromJSON, NftItemsToJSON, + ReduceIndexingLatencyDefaultResponseFromJSON, + ReduceIndexingLatencyDefaultResponseToJSON, SubscriptionsFromJSON, SubscriptionsToJSON, TraceIDsFromJSON, @@ -120,7 +120,7 @@ export interface GetAccountJettonHistoryByIDRequest { export interface GetAccountJettonsBalancesRequest { accountId: string; - currencies?: string; + currencies?: Array; } export interface GetAccountJettonsHistoryRequest { @@ -306,7 +306,7 @@ export interface AccountsApiInterface { /** * Get all Jettons balances by owner address * @param {string} accountId account ID - * @param {string} [currencies] accept ton and all possible fiat currencies, separated by commas + * @param {Array} [currencies] accept ton and all possible fiat currencies, separated by commas * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof AccountsApiInterface @@ -451,8 +451,11 @@ export class AccountsApi extends runtime.BaseAPI implements AccountsApiInterface * Get account\'s domains */ async accountDnsBackResolveRaw(requestParameters: AccountDnsBackResolveRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.accountId === null || requestParameters.accountId === undefined) { - throw new runtime.RequiredError('accountId','Required parameter requestParameters.accountId was null or undefined when calling accountDnsBackResolve.'); + if (requestParameters['accountId'] == null) { + throw new runtime.RequiredError( + 'accountId', + 'Required parameter "accountId" was null or undefined when calling accountDnsBackResolve().' + ); } const queryParameters: any = {}; @@ -460,7 +463,7 @@ export class AccountsApi extends runtime.BaseAPI implements AccountsApiInterface const headerParameters: runtime.HTTPHeaders = {}; const response = await this.request({ - path: `/v2/accounts/{account_id}/dns/backresolve`.replace(`{${"account_id"}}`, encodeURIComponent(String(requestParameters.accountId))), + path: `/v2/accounts/{account_id}/dns/backresolve`.replace(`{${"account_id"}}`, encodeURIComponent(String(requestParameters['accountId']))), method: 'GET', headers: headerParameters, query: queryParameters, @@ -481,8 +484,11 @@ export class AccountsApi extends runtime.BaseAPI implements AccountsApiInterface * parse address and display in all formats */ async addressParseRaw(requestParameters: AddressParseRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.accountId === null || requestParameters.accountId === undefined) { - throw new runtime.RequiredError('accountId','Required parameter requestParameters.accountId was null or undefined when calling addressParse.'); + if (requestParameters['accountId'] == null) { + throw new runtime.RequiredError( + 'accountId', + 'Required parameter "accountId" was null or undefined when calling addressParse().' + ); } const queryParameters: any = {}; @@ -490,7 +496,7 @@ export class AccountsApi extends runtime.BaseAPI implements AccountsApiInterface const headerParameters: runtime.HTTPHeaders = {}; const response = await this.request({ - path: `/v2/address/{account_id}/parse`.replace(`{${"account_id"}}`, encodeURIComponent(String(requestParameters.accountId))), + path: `/v2/address/{account_id}/parse`.replace(`{${"account_id"}}`, encodeURIComponent(String(requestParameters['accountId']))), method: 'GET', headers: headerParameters, query: queryParameters, @@ -511,8 +517,11 @@ export class AccountsApi extends runtime.BaseAPI implements AccountsApiInterface * Get human-friendly information about an account without low-level details. */ async getAccountRaw(requestParameters: GetAccountRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.accountId === null || requestParameters.accountId === undefined) { - throw new runtime.RequiredError('accountId','Required parameter requestParameters.accountId was null or undefined when calling getAccount.'); + if (requestParameters['accountId'] == null) { + throw new runtime.RequiredError( + 'accountId', + 'Required parameter "accountId" was null or undefined when calling getAccount().' + ); } const queryParameters: any = {}; @@ -520,7 +529,7 @@ export class AccountsApi extends runtime.BaseAPI implements AccountsApiInterface const headerParameters: runtime.HTTPHeaders = {}; const response = await this.request({ - path: `/v2/accounts/{account_id}`.replace(`{${"account_id"}}`, encodeURIComponent(String(requestParameters.accountId))), + path: `/v2/accounts/{account_id}`.replace(`{${"account_id"}}`, encodeURIComponent(String(requestParameters['accountId']))), method: 'GET', headers: headerParameters, query: queryParameters, @@ -541,32 +550,41 @@ export class AccountsApi extends runtime.BaseAPI implements AccountsApiInterface * Get account\'s balance change */ async getAccountDiffRaw(requestParameters: GetAccountDiffRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.accountId === null || requestParameters.accountId === undefined) { - throw new runtime.RequiredError('accountId','Required parameter requestParameters.accountId was null or undefined when calling getAccountDiff.'); + if (requestParameters['accountId'] == null) { + throw new runtime.RequiredError( + 'accountId', + 'Required parameter "accountId" was null or undefined when calling getAccountDiff().' + ); } - if (requestParameters.startDate === null || requestParameters.startDate === undefined) { - throw new runtime.RequiredError('startDate','Required parameter requestParameters.startDate was null or undefined when calling getAccountDiff.'); + if (requestParameters['startDate'] == null) { + throw new runtime.RequiredError( + 'startDate', + 'Required parameter "startDate" was null or undefined when calling getAccountDiff().' + ); } - if (requestParameters.endDate === null || requestParameters.endDate === undefined) { - throw new runtime.RequiredError('endDate','Required parameter requestParameters.endDate was null or undefined when calling getAccountDiff.'); + if (requestParameters['endDate'] == null) { + throw new runtime.RequiredError( + 'endDate', + 'Required parameter "endDate" was null or undefined when calling getAccountDiff().' + ); } const queryParameters: any = {}; - if (requestParameters.startDate !== undefined) { - queryParameters['start_date'] = requestParameters.startDate; + if (requestParameters['startDate'] != null) { + queryParameters['start_date'] = requestParameters['startDate']; } - if (requestParameters.endDate !== undefined) { - queryParameters['end_date'] = requestParameters.endDate; + if (requestParameters['endDate'] != null) { + queryParameters['end_date'] = requestParameters['endDate']; } const headerParameters: runtime.HTTPHeaders = {}; const response = await this.request({ - path: `/v2/accounts/{account_id}/diff`.replace(`{${"account_id"}}`, encodeURIComponent(String(requestParameters.accountId))), + path: `/v2/accounts/{account_id}/diff`.replace(`{${"account_id"}}`, encodeURIComponent(String(requestParameters['accountId']))), method: 'GET', headers: headerParameters, query: queryParameters, @@ -587,20 +605,23 @@ export class AccountsApi extends runtime.BaseAPI implements AccountsApiInterface * Get expiring account .ton dns */ async getAccountDnsExpiringRaw(requestParameters: GetAccountDnsExpiringRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.accountId === null || requestParameters.accountId === undefined) { - throw new runtime.RequiredError('accountId','Required parameter requestParameters.accountId was null or undefined when calling getAccountDnsExpiring.'); + if (requestParameters['accountId'] == null) { + throw new runtime.RequiredError( + 'accountId', + 'Required parameter "accountId" was null or undefined when calling getAccountDnsExpiring().' + ); } const queryParameters: any = {}; - if (requestParameters.period !== undefined) { - queryParameters['period'] = requestParameters.period; + if (requestParameters['period'] != null) { + queryParameters['period'] = requestParameters['period']; } const headerParameters: runtime.HTTPHeaders = {}; const response = await this.request({ - path: `/v2/accounts/{account_id}/dns/expiring`.replace(`{${"account_id"}}`, encodeURIComponent(String(requestParameters.accountId))), + path: `/v2/accounts/{account_id}/dns/expiring`.replace(`{${"account_id"}}`, encodeURIComponent(String(requestParameters['accountId']))), method: 'GET', headers: headerParameters, query: queryParameters, @@ -621,28 +642,34 @@ export class AccountsApi extends runtime.BaseAPI implements AccountsApiInterface * Get event for an account by event_id */ async getAccountEventRaw(requestParameters: GetAccountEventRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.accountId === null || requestParameters.accountId === undefined) { - throw new runtime.RequiredError('accountId','Required parameter requestParameters.accountId was null or undefined when calling getAccountEvent.'); + if (requestParameters['accountId'] == null) { + throw new runtime.RequiredError( + 'accountId', + 'Required parameter "accountId" was null or undefined when calling getAccountEvent().' + ); } - if (requestParameters.eventId === null || requestParameters.eventId === undefined) { - throw new runtime.RequiredError('eventId','Required parameter requestParameters.eventId was null or undefined when calling getAccountEvent.'); + if (requestParameters['eventId'] == null) { + throw new runtime.RequiredError( + 'eventId', + 'Required parameter "eventId" was null or undefined when calling getAccountEvent().' + ); } const queryParameters: any = {}; - if (requestParameters.subjectOnly !== undefined) { - queryParameters['subject_only'] = requestParameters.subjectOnly; + if (requestParameters['subjectOnly'] != null) { + queryParameters['subject_only'] = requestParameters['subjectOnly']; } const headerParameters: runtime.HTTPHeaders = {}; - if (requestParameters.acceptLanguage !== undefined && requestParameters.acceptLanguage !== null) { - headerParameters['Accept-Language'] = String(requestParameters.acceptLanguage); + if (requestParameters['acceptLanguage'] != null) { + headerParameters['Accept-Language'] = String(requestParameters['acceptLanguage']); } const response = await this.request({ - path: `/v2/accounts/{account_id}/events/{event_id}`.replace(`{${"account_id"}}`, encodeURIComponent(String(requestParameters.accountId))).replace(`{${"event_id"}}`, encodeURIComponent(String(requestParameters.eventId))), + path: `/v2/accounts/{account_id}/events/{event_id}`.replace(`{${"account_id"}}`, encodeURIComponent(String(requestParameters['accountId']))).replace(`{${"event_id"}}`, encodeURIComponent(String(requestParameters['eventId']))), method: 'GET', headers: headerParameters, query: queryParameters, @@ -663,48 +690,54 @@ export class AccountsApi extends runtime.BaseAPI implements AccountsApiInterface * Get events for an account. Each event is built on top of a trace which is a series of transactions caused by one inbound message. TonAPI looks for known patterns inside the trace and splits the trace into actions, where a single action represents a meaningful high-level operation like a Jetton Transfer or an NFT Purchase. Actions are expected to be shown to users. It is advised not to build any logic on top of actions because actions can be changed at any time. */ async getAccountEventsRaw(requestParameters: GetAccountEventsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.accountId === null || requestParameters.accountId === undefined) { - throw new runtime.RequiredError('accountId','Required parameter requestParameters.accountId was null or undefined when calling getAccountEvents.'); + if (requestParameters['accountId'] == null) { + throw new runtime.RequiredError( + 'accountId', + 'Required parameter "accountId" was null or undefined when calling getAccountEvents().' + ); } - if (requestParameters.limit === null || requestParameters.limit === undefined) { - throw new runtime.RequiredError('limit','Required parameter requestParameters.limit was null or undefined when calling getAccountEvents.'); + if (requestParameters['limit'] == null) { + throw new runtime.RequiredError( + 'limit', + 'Required parameter "limit" was null or undefined when calling getAccountEvents().' + ); } const queryParameters: any = {}; - if (requestParameters.initiator !== undefined) { - queryParameters['initiator'] = requestParameters.initiator; + if (requestParameters['initiator'] != null) { + queryParameters['initiator'] = requestParameters['initiator']; } - if (requestParameters.subjectOnly !== undefined) { - queryParameters['subject_only'] = requestParameters.subjectOnly; + if (requestParameters['subjectOnly'] != null) { + queryParameters['subject_only'] = requestParameters['subjectOnly']; } - if (requestParameters.beforeLt !== undefined) { - queryParameters['before_lt'] = requestParameters.beforeLt; + if (requestParameters['beforeLt'] != null) { + queryParameters['before_lt'] = requestParameters['beforeLt']; } - if (requestParameters.limit !== undefined) { - queryParameters['limit'] = requestParameters.limit; + if (requestParameters['limit'] != null) { + queryParameters['limit'] = requestParameters['limit']; } - if (requestParameters.startDate !== undefined) { - queryParameters['start_date'] = requestParameters.startDate; + if (requestParameters['startDate'] != null) { + queryParameters['start_date'] = requestParameters['startDate']; } - if (requestParameters.endDate !== undefined) { - queryParameters['end_date'] = requestParameters.endDate; + if (requestParameters['endDate'] != null) { + queryParameters['end_date'] = requestParameters['endDate']; } const headerParameters: runtime.HTTPHeaders = {}; - if (requestParameters.acceptLanguage !== undefined && requestParameters.acceptLanguage !== null) { - headerParameters['Accept-Language'] = String(requestParameters.acceptLanguage); + if (requestParameters['acceptLanguage'] != null) { + headerParameters['Accept-Language'] = String(requestParameters['acceptLanguage']); } const response = await this.request({ - path: `/v2/accounts/{account_id}/events`.replace(`{${"account_id"}}`, encodeURIComponent(String(requestParameters.accountId))), + path: `/v2/accounts/{account_id}/events`.replace(`{${"account_id"}}`, encodeURIComponent(String(requestParameters['accountId']))), method: 'GET', headers: headerParameters, query: queryParameters, @@ -725,44 +758,53 @@ export class AccountsApi extends runtime.BaseAPI implements AccountsApiInterface * Get the transfer jetton history for account and jetton */ async getAccountJettonHistoryByIDRaw(requestParameters: GetAccountJettonHistoryByIDRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.accountId === null || requestParameters.accountId === undefined) { - throw new runtime.RequiredError('accountId','Required parameter requestParameters.accountId was null or undefined when calling getAccountJettonHistoryByID.'); + if (requestParameters['accountId'] == null) { + throw new runtime.RequiredError( + 'accountId', + 'Required parameter "accountId" was null or undefined when calling getAccountJettonHistoryByID().' + ); } - if (requestParameters.jettonId === null || requestParameters.jettonId === undefined) { - throw new runtime.RequiredError('jettonId','Required parameter requestParameters.jettonId was null or undefined when calling getAccountJettonHistoryByID.'); + if (requestParameters['jettonId'] == null) { + throw new runtime.RequiredError( + 'jettonId', + 'Required parameter "jettonId" was null or undefined when calling getAccountJettonHistoryByID().' + ); } - if (requestParameters.limit === null || requestParameters.limit === undefined) { - throw new runtime.RequiredError('limit','Required parameter requestParameters.limit was null or undefined when calling getAccountJettonHistoryByID.'); + if (requestParameters['limit'] == null) { + throw new runtime.RequiredError( + 'limit', + 'Required parameter "limit" was null or undefined when calling getAccountJettonHistoryByID().' + ); } const queryParameters: any = {}; - if (requestParameters.beforeLt !== undefined) { - queryParameters['before_lt'] = requestParameters.beforeLt; + if (requestParameters['beforeLt'] != null) { + queryParameters['before_lt'] = requestParameters['beforeLt']; } - if (requestParameters.limit !== undefined) { - queryParameters['limit'] = requestParameters.limit; + if (requestParameters['limit'] != null) { + queryParameters['limit'] = requestParameters['limit']; } - if (requestParameters.startDate !== undefined) { - queryParameters['start_date'] = requestParameters.startDate; + if (requestParameters['startDate'] != null) { + queryParameters['start_date'] = requestParameters['startDate']; } - if (requestParameters.endDate !== undefined) { - queryParameters['end_date'] = requestParameters.endDate; + if (requestParameters['endDate'] != null) { + queryParameters['end_date'] = requestParameters['endDate']; } const headerParameters: runtime.HTTPHeaders = {}; - if (requestParameters.acceptLanguage !== undefined && requestParameters.acceptLanguage !== null) { - headerParameters['Accept-Language'] = String(requestParameters.acceptLanguage); + if (requestParameters['acceptLanguage'] != null) { + headerParameters['Accept-Language'] = String(requestParameters['acceptLanguage']); } const response = await this.request({ - path: `/v2/accounts/{account_id}/jettons/{jetton_id}/history`.replace(`{${"account_id"}}`, encodeURIComponent(String(requestParameters.accountId))).replace(`{${"jetton_id"}}`, encodeURIComponent(String(requestParameters.jettonId))), + path: `/v2/accounts/{account_id}/jettons/{jetton_id}/history`.replace(`{${"account_id"}}`, encodeURIComponent(String(requestParameters['accountId']))).replace(`{${"jetton_id"}}`, encodeURIComponent(String(requestParameters['jettonId']))), method: 'GET', headers: headerParameters, query: queryParameters, @@ -783,20 +825,23 @@ export class AccountsApi extends runtime.BaseAPI implements AccountsApiInterface * Get all Jettons balances by owner address */ async getAccountJettonsBalancesRaw(requestParameters: GetAccountJettonsBalancesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.accountId === null || requestParameters.accountId === undefined) { - throw new runtime.RequiredError('accountId','Required parameter requestParameters.accountId was null or undefined when calling getAccountJettonsBalances.'); + if (requestParameters['accountId'] == null) { + throw new runtime.RequiredError( + 'accountId', + 'Required parameter "accountId" was null or undefined when calling getAccountJettonsBalances().' + ); } const queryParameters: any = {}; - if (requestParameters.currencies !== undefined) { - queryParameters['currencies'] = requestParameters.currencies; + if (requestParameters['currencies'] != null) { + queryParameters['currencies'] = requestParameters['currencies']!.join(runtime.COLLECTION_FORMATS["csv"]); } const headerParameters: runtime.HTTPHeaders = {}; const response = await this.request({ - path: `/v2/accounts/{account_id}/jettons`.replace(`{${"account_id"}}`, encodeURIComponent(String(requestParameters.accountId))), + path: `/v2/accounts/{account_id}/jettons`.replace(`{${"account_id"}}`, encodeURIComponent(String(requestParameters['accountId']))), method: 'GET', headers: headerParameters, query: queryParameters, @@ -817,40 +862,46 @@ export class AccountsApi extends runtime.BaseAPI implements AccountsApiInterface * Get the transfer jettons history for account */ async getAccountJettonsHistoryRaw(requestParameters: GetAccountJettonsHistoryRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.accountId === null || requestParameters.accountId === undefined) { - throw new runtime.RequiredError('accountId','Required parameter requestParameters.accountId was null or undefined when calling getAccountJettonsHistory.'); + if (requestParameters['accountId'] == null) { + throw new runtime.RequiredError( + 'accountId', + 'Required parameter "accountId" was null or undefined when calling getAccountJettonsHistory().' + ); } - if (requestParameters.limit === null || requestParameters.limit === undefined) { - throw new runtime.RequiredError('limit','Required parameter requestParameters.limit was null or undefined when calling getAccountJettonsHistory.'); + if (requestParameters['limit'] == null) { + throw new runtime.RequiredError( + 'limit', + 'Required parameter "limit" was null or undefined when calling getAccountJettonsHistory().' + ); } const queryParameters: any = {}; - if (requestParameters.beforeLt !== undefined) { - queryParameters['before_lt'] = requestParameters.beforeLt; + if (requestParameters['beforeLt'] != null) { + queryParameters['before_lt'] = requestParameters['beforeLt']; } - if (requestParameters.limit !== undefined) { - queryParameters['limit'] = requestParameters.limit; + if (requestParameters['limit'] != null) { + queryParameters['limit'] = requestParameters['limit']; } - if (requestParameters.startDate !== undefined) { - queryParameters['start_date'] = requestParameters.startDate; + if (requestParameters['startDate'] != null) { + queryParameters['start_date'] = requestParameters['startDate']; } - if (requestParameters.endDate !== undefined) { - queryParameters['end_date'] = requestParameters.endDate; + if (requestParameters['endDate'] != null) { + queryParameters['end_date'] = requestParameters['endDate']; } const headerParameters: runtime.HTTPHeaders = {}; - if (requestParameters.acceptLanguage !== undefined && requestParameters.acceptLanguage !== null) { - headerParameters['Accept-Language'] = String(requestParameters.acceptLanguage); + if (requestParameters['acceptLanguage'] != null) { + headerParameters['Accept-Language'] = String(requestParameters['acceptLanguage']); } const response = await this.request({ - path: `/v2/accounts/{account_id}/jettons/history`.replace(`{${"account_id"}}`, encodeURIComponent(String(requestParameters.accountId))), + path: `/v2/accounts/{account_id}/jettons/history`.replace(`{${"account_id"}}`, encodeURIComponent(String(requestParameters['accountId']))), method: 'GET', headers: headerParameters, query: queryParameters, @@ -871,32 +922,35 @@ export class AccountsApi extends runtime.BaseAPI implements AccountsApiInterface * Get all NFT items by owner address */ async getAccountNftItemsRaw(requestParameters: GetAccountNftItemsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.accountId === null || requestParameters.accountId === undefined) { - throw new runtime.RequiredError('accountId','Required parameter requestParameters.accountId was null or undefined when calling getAccountNftItems.'); + if (requestParameters['accountId'] == null) { + throw new runtime.RequiredError( + 'accountId', + 'Required parameter "accountId" was null or undefined when calling getAccountNftItems().' + ); } const queryParameters: any = {}; - if (requestParameters.collection !== undefined) { - queryParameters['collection'] = requestParameters.collection; + if (requestParameters['collection'] != null) { + queryParameters['collection'] = requestParameters['collection']; } - if (requestParameters.limit !== undefined) { - queryParameters['limit'] = requestParameters.limit; + if (requestParameters['limit'] != null) { + queryParameters['limit'] = requestParameters['limit']; } - if (requestParameters.offset !== undefined) { - queryParameters['offset'] = requestParameters.offset; + if (requestParameters['offset'] != null) { + queryParameters['offset'] = requestParameters['offset']; } - if (requestParameters.indirectOwnership !== undefined) { - queryParameters['indirect_ownership'] = requestParameters.indirectOwnership; + if (requestParameters['indirectOwnership'] != null) { + queryParameters['indirect_ownership'] = requestParameters['indirectOwnership']; } const headerParameters: runtime.HTTPHeaders = {}; const response = await this.request({ - path: `/v2/accounts/{account_id}/nfts`.replace(`{${"account_id"}}`, encodeURIComponent(String(requestParameters.accountId))), + path: `/v2/accounts/{account_id}/nfts`.replace(`{${"account_id"}}`, encodeURIComponent(String(requestParameters['accountId']))), method: 'GET', headers: headerParameters, query: queryParameters, @@ -917,8 +971,11 @@ export class AccountsApi extends runtime.BaseAPI implements AccountsApiInterface * Get public key by account id */ async getAccountPublicKeyRaw(requestParameters: GetAccountPublicKeyRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.accountId === null || requestParameters.accountId === undefined) { - throw new runtime.RequiredError('accountId','Required parameter requestParameters.accountId was null or undefined when calling getAccountPublicKey.'); + if (requestParameters['accountId'] == null) { + throw new runtime.RequiredError( + 'accountId', + 'Required parameter "accountId" was null or undefined when calling getAccountPublicKey().' + ); } const queryParameters: any = {}; @@ -926,7 +983,7 @@ export class AccountsApi extends runtime.BaseAPI implements AccountsApiInterface const headerParameters: runtime.HTTPHeaders = {}; const response = await this.request({ - path: `/v2/accounts/{account_id}/publickey`.replace(`{${"account_id"}}`, encodeURIComponent(String(requestParameters.accountId))), + path: `/v2/accounts/{account_id}/publickey`.replace(`{${"account_id"}}`, encodeURIComponent(String(requestParameters['accountId']))), method: 'GET', headers: headerParameters, query: queryParameters, @@ -947,8 +1004,11 @@ export class AccountsApi extends runtime.BaseAPI implements AccountsApiInterface * Get all subscriptions by wallet address */ async getAccountSubscriptionsRaw(requestParameters: GetAccountSubscriptionsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.accountId === null || requestParameters.accountId === undefined) { - throw new runtime.RequiredError('accountId','Required parameter requestParameters.accountId was null or undefined when calling getAccountSubscriptions.'); + if (requestParameters['accountId'] == null) { + throw new runtime.RequiredError( + 'accountId', + 'Required parameter "accountId" was null or undefined when calling getAccountSubscriptions().' + ); } const queryParameters: any = {}; @@ -956,7 +1016,7 @@ export class AccountsApi extends runtime.BaseAPI implements AccountsApiInterface const headerParameters: runtime.HTTPHeaders = {}; const response = await this.request({ - path: `/v2/accounts/{account_id}/subscriptions`.replace(`{${"account_id"}}`, encodeURIComponent(String(requestParameters.accountId))), + path: `/v2/accounts/{account_id}/subscriptions`.replace(`{${"account_id"}}`, encodeURIComponent(String(requestParameters['accountId']))), method: 'GET', headers: headerParameters, query: queryParameters, @@ -977,20 +1037,23 @@ export class AccountsApi extends runtime.BaseAPI implements AccountsApiInterface * Get traces for account */ async getAccountTracesRaw(requestParameters: GetAccountTracesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.accountId === null || requestParameters.accountId === undefined) { - throw new runtime.RequiredError('accountId','Required parameter requestParameters.accountId was null or undefined when calling getAccountTraces.'); + if (requestParameters['accountId'] == null) { + throw new runtime.RequiredError( + 'accountId', + 'Required parameter "accountId" was null or undefined when calling getAccountTraces().' + ); } const queryParameters: any = {}; - if (requestParameters.limit !== undefined) { - queryParameters['limit'] = requestParameters.limit; + if (requestParameters['limit'] != null) { + queryParameters['limit'] = requestParameters['limit']; } const headerParameters: runtime.HTTPHeaders = {}; const response = await this.request({ - path: `/v2/accounts/{account_id}/traces`.replace(`{${"account_id"}}`, encodeURIComponent(String(requestParameters.accountId))), + path: `/v2/accounts/{account_id}/traces`.replace(`{${"account_id"}}`, encodeURIComponent(String(requestParameters['accountId']))), method: 'GET', headers: headerParameters, query: queryParameters, @@ -1022,7 +1085,7 @@ export class AccountsApi extends runtime.BaseAPI implements AccountsApiInterface method: 'POST', headers: headerParameters, query: queryParameters, - body: GetAccountsRequestToJSON(requestParameters.getAccountsRequest), + body: GetAccountsRequestToJSON(requestParameters['getAccountsRequest']), }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => AccountsFromJSON(jsonValue)); @@ -1040,8 +1103,11 @@ export class AccountsApi extends runtime.BaseAPI implements AccountsApiInterface * Update internal cache for a particular account */ async reindexAccountRaw(requestParameters: ReindexAccountRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.accountId === null || requestParameters.accountId === undefined) { - throw new runtime.RequiredError('accountId','Required parameter requestParameters.accountId was null or undefined when calling reindexAccount.'); + if (requestParameters['accountId'] == null) { + throw new runtime.RequiredError( + 'accountId', + 'Required parameter "accountId" was null or undefined when calling reindexAccount().' + ); } const queryParameters: any = {}; @@ -1049,7 +1115,7 @@ export class AccountsApi extends runtime.BaseAPI implements AccountsApiInterface const headerParameters: runtime.HTTPHeaders = {}; const response = await this.request({ - path: `/v2/accounts/{account_id}/reindex`.replace(`{${"account_id"}}`, encodeURIComponent(String(requestParameters.accountId))), + path: `/v2/accounts/{account_id}/reindex`.replace(`{${"account_id"}}`, encodeURIComponent(String(requestParameters['accountId']))), method: 'POST', headers: headerParameters, query: queryParameters, @@ -1069,14 +1135,17 @@ export class AccountsApi extends runtime.BaseAPI implements AccountsApiInterface * Search by account domain name */ async searchAccountsRaw(requestParameters: SearchAccountsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.name === null || requestParameters.name === undefined) { - throw new runtime.RequiredError('name','Required parameter requestParameters.name was null or undefined when calling searchAccounts.'); + if (requestParameters['name'] == null) { + throw new runtime.RequiredError( + 'name', + 'Required parameter "name" was null or undefined when calling searchAccounts().' + ); } const queryParameters: any = {}; - if (requestParameters.name !== undefined) { - queryParameters['name'] = requestParameters.name; + if (requestParameters['name'] != null) { + queryParameters['name'] = requestParameters['name']; } const headerParameters: runtime.HTTPHeaders = {}; diff --git a/packages/core/src/tonApiV2/apis/BlockchainApi.ts b/packages/core/src/tonApiV2/apis/BlockchainApi.ts index ca4f987c5..2cee60d0f 100644 --- a/packages/core/src/tonApiV2/apis/BlockchainApi.ts +++ b/packages/core/src/tonApiV2/apis/BlockchainApi.ts @@ -21,10 +21,11 @@ import type { BlockchainBlocks, BlockchainConfig, BlockchainRawAccount, - GetBlockchainBlockDefaultResponse, MethodExecutionResult, RawBlockchainConfig, + ReduceIndexingLatencyDefaultResponse, SendBlockchainMessageRequest, + ServiceStatus, Transaction, Transactions, Validators, @@ -42,14 +43,16 @@ import { BlockchainConfigToJSON, BlockchainRawAccountFromJSON, BlockchainRawAccountToJSON, - GetBlockchainBlockDefaultResponseFromJSON, - GetBlockchainBlockDefaultResponseToJSON, MethodExecutionResultFromJSON, MethodExecutionResultToJSON, RawBlockchainConfigFromJSON, RawBlockchainConfigToJSON, + ReduceIndexingLatencyDefaultResponseFromJSON, + ReduceIndexingLatencyDefaultResponseToJSON, SendBlockchainMessageRequestFromJSON, SendBlockchainMessageRequestToJSON, + ServiceStatusFromJSON, + ServiceStatusToJSON, TransactionFromJSON, TransactionToJSON, TransactionsFromJSON, @@ -365,6 +368,19 @@ export interface BlockchainApiInterface { */ getRawBlockchainConfigFromBlock(requestParameters: GetRawBlockchainConfigFromBlockRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise; + /** + * Reduce indexing latency + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof BlockchainApiInterface + */ + reduceIndexingLatencyRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>; + + /** + * Reduce indexing latency + */ + reduceIndexingLatency(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise; + /** * Send message to blockchain * @param {SendBlockchainMessageRequest} sendBlockchainMessageRequest both a single boc and a batch of boc serialized in base64 are accepted @@ -390,8 +406,11 @@ export class BlockchainApi extends runtime.BaseAPI implements BlockchainApiInter * Blockchain account inspect */ async blockchainAccountInspectRaw(requestParameters: BlockchainAccountInspectRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.accountId === null || requestParameters.accountId === undefined) { - throw new runtime.RequiredError('accountId','Required parameter requestParameters.accountId was null or undefined when calling blockchainAccountInspect.'); + if (requestParameters['accountId'] == null) { + throw new runtime.RequiredError( + 'accountId', + 'Required parameter "accountId" was null or undefined when calling blockchainAccountInspect().' + ); } const queryParameters: any = {}; @@ -399,7 +418,7 @@ export class BlockchainApi extends runtime.BaseAPI implements BlockchainApiInter const headerParameters: runtime.HTTPHeaders = {}; const response = await this.request({ - path: `/v2/blockchain/accounts/{account_id}/inspect`.replace(`{${"account_id"}}`, encodeURIComponent(String(requestParameters.accountId))), + path: `/v2/blockchain/accounts/{account_id}/inspect`.replace(`{${"account_id"}}`, encodeURIComponent(String(requestParameters['accountId']))), method: 'GET', headers: headerParameters, query: queryParameters, @@ -420,24 +439,30 @@ export class BlockchainApi extends runtime.BaseAPI implements BlockchainApiInter * Execute get method for account */ async execGetMethodForBlockchainAccountRaw(requestParameters: ExecGetMethodForBlockchainAccountRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.accountId === null || requestParameters.accountId === undefined) { - throw new runtime.RequiredError('accountId','Required parameter requestParameters.accountId was null or undefined when calling execGetMethodForBlockchainAccount.'); + if (requestParameters['accountId'] == null) { + throw new runtime.RequiredError( + 'accountId', + 'Required parameter "accountId" was null or undefined when calling execGetMethodForBlockchainAccount().' + ); } - if (requestParameters.methodName === null || requestParameters.methodName === undefined) { - throw new runtime.RequiredError('methodName','Required parameter requestParameters.methodName was null or undefined when calling execGetMethodForBlockchainAccount.'); + if (requestParameters['methodName'] == null) { + throw new runtime.RequiredError( + 'methodName', + 'Required parameter "methodName" was null or undefined when calling execGetMethodForBlockchainAccount().' + ); } const queryParameters: any = {}; - if (requestParameters.args) { - queryParameters['args'] = requestParameters.args; + if (requestParameters['args'] != null) { + queryParameters['args'] = requestParameters['args']; } const headerParameters: runtime.HTTPHeaders = {}; const response = await this.request({ - path: `/v2/blockchain/accounts/{account_id}/methods/{method_name}`.replace(`{${"account_id"}}`, encodeURIComponent(String(requestParameters.accountId))).replace(`{${"method_name"}}`, encodeURIComponent(String(requestParameters.methodName))), + path: `/v2/blockchain/accounts/{account_id}/methods/{method_name}`.replace(`{${"account_id"}}`, encodeURIComponent(String(requestParameters['accountId']))).replace(`{${"method_name"}}`, encodeURIComponent(String(requestParameters['methodName']))), method: 'GET', headers: headerParameters, query: queryParameters, @@ -458,28 +483,31 @@ export class BlockchainApi extends runtime.BaseAPI implements BlockchainApiInter * Get account transactions */ async getBlockchainAccountTransactionsRaw(requestParameters: GetBlockchainAccountTransactionsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.accountId === null || requestParameters.accountId === undefined) { - throw new runtime.RequiredError('accountId','Required parameter requestParameters.accountId was null or undefined when calling getBlockchainAccountTransactions.'); + if (requestParameters['accountId'] == null) { + throw new runtime.RequiredError( + 'accountId', + 'Required parameter "accountId" was null or undefined when calling getBlockchainAccountTransactions().' + ); } const queryParameters: any = {}; - if (requestParameters.afterLt !== undefined) { - queryParameters['after_lt'] = requestParameters.afterLt; + if (requestParameters['afterLt'] != null) { + queryParameters['after_lt'] = requestParameters['afterLt']; } - if (requestParameters.beforeLt !== undefined) { - queryParameters['before_lt'] = requestParameters.beforeLt; + if (requestParameters['beforeLt'] != null) { + queryParameters['before_lt'] = requestParameters['beforeLt']; } - if (requestParameters.limit !== undefined) { - queryParameters['limit'] = requestParameters.limit; + if (requestParameters['limit'] != null) { + queryParameters['limit'] = requestParameters['limit']; } const headerParameters: runtime.HTTPHeaders = {}; const response = await this.request({ - path: `/v2/blockchain/accounts/{account_id}/transactions`.replace(`{${"account_id"}}`, encodeURIComponent(String(requestParameters.accountId))), + path: `/v2/blockchain/accounts/{account_id}/transactions`.replace(`{${"account_id"}}`, encodeURIComponent(String(requestParameters['accountId']))), method: 'GET', headers: headerParameters, query: queryParameters, @@ -500,8 +528,11 @@ export class BlockchainApi extends runtime.BaseAPI implements BlockchainApiInter * Get blockchain block data */ async getBlockchainBlockRaw(requestParameters: GetBlockchainBlockRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.blockId === null || requestParameters.blockId === undefined) { - throw new runtime.RequiredError('blockId','Required parameter requestParameters.blockId was null or undefined when calling getBlockchainBlock.'); + if (requestParameters['blockId'] == null) { + throw new runtime.RequiredError( + 'blockId', + 'Required parameter "blockId" was null or undefined when calling getBlockchainBlock().' + ); } const queryParameters: any = {}; @@ -509,7 +540,7 @@ export class BlockchainApi extends runtime.BaseAPI implements BlockchainApiInter const headerParameters: runtime.HTTPHeaders = {}; const response = await this.request({ - path: `/v2/blockchain/blocks/{block_id}`.replace(`{${"block_id"}}`, encodeURIComponent(String(requestParameters.blockId))), + path: `/v2/blockchain/blocks/{block_id}`.replace(`{${"block_id"}}`, encodeURIComponent(String(requestParameters['blockId']))), method: 'GET', headers: headerParameters, query: queryParameters, @@ -530,8 +561,11 @@ export class BlockchainApi extends runtime.BaseAPI implements BlockchainApiInter * Get transactions from block */ async getBlockchainBlockTransactionsRaw(requestParameters: GetBlockchainBlockTransactionsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.blockId === null || requestParameters.blockId === undefined) { - throw new runtime.RequiredError('blockId','Required parameter requestParameters.blockId was null or undefined when calling getBlockchainBlockTransactions.'); + if (requestParameters['blockId'] == null) { + throw new runtime.RequiredError( + 'blockId', + 'Required parameter "blockId" was null or undefined when calling getBlockchainBlockTransactions().' + ); } const queryParameters: any = {}; @@ -539,7 +573,7 @@ export class BlockchainApi extends runtime.BaseAPI implements BlockchainApiInter const headerParameters: runtime.HTTPHeaders = {}; const response = await this.request({ - path: `/v2/blockchain/blocks/{block_id}/transactions`.replace(`{${"block_id"}}`, encodeURIComponent(String(requestParameters.blockId))), + path: `/v2/blockchain/blocks/{block_id}/transactions`.replace(`{${"block_id"}}`, encodeURIComponent(String(requestParameters['blockId']))), method: 'GET', headers: headerParameters, query: queryParameters, @@ -586,8 +620,11 @@ export class BlockchainApi extends runtime.BaseAPI implements BlockchainApiInter * Get blockchain config from a specific block, if present. */ async getBlockchainConfigFromBlockRaw(requestParameters: GetBlockchainConfigFromBlockRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.masterchainSeqno === null || requestParameters.masterchainSeqno === undefined) { - throw new runtime.RequiredError('masterchainSeqno','Required parameter requestParameters.masterchainSeqno was null or undefined when calling getBlockchainConfigFromBlock.'); + if (requestParameters['masterchainSeqno'] == null) { + throw new runtime.RequiredError( + 'masterchainSeqno', + 'Required parameter "masterchainSeqno" was null or undefined when calling getBlockchainConfigFromBlock().' + ); } const queryParameters: any = {}; @@ -595,7 +632,7 @@ export class BlockchainApi extends runtime.BaseAPI implements BlockchainApiInter const headerParameters: runtime.HTTPHeaders = {}; const response = await this.request({ - path: `/v2/blockchain/masterchain/{masterchain_seqno}/config`.replace(`{${"masterchain_seqno"}}`, encodeURIComponent(String(requestParameters.masterchainSeqno))), + path: `/v2/blockchain/masterchain/{masterchain_seqno}/config`.replace(`{${"masterchain_seqno"}}`, encodeURIComponent(String(requestParameters['masterchainSeqno']))), method: 'GET', headers: headerParameters, query: queryParameters, @@ -616,8 +653,11 @@ export class BlockchainApi extends runtime.BaseAPI implements BlockchainApiInter * Get all blocks in all shards and workchains between target and previous masterchain block according to shards last blocks snapshot in masterchain. We don\'t recommend to build your app around this method because it has problem with scalability and will work very slow in the future. */ async getBlockchainMasterchainBlocksRaw(requestParameters: GetBlockchainMasterchainBlocksRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.masterchainSeqno === null || requestParameters.masterchainSeqno === undefined) { - throw new runtime.RequiredError('masterchainSeqno','Required parameter requestParameters.masterchainSeqno was null or undefined when calling getBlockchainMasterchainBlocks.'); + if (requestParameters['masterchainSeqno'] == null) { + throw new runtime.RequiredError( + 'masterchainSeqno', + 'Required parameter "masterchainSeqno" was null or undefined when calling getBlockchainMasterchainBlocks().' + ); } const queryParameters: any = {}; @@ -625,7 +665,7 @@ export class BlockchainApi extends runtime.BaseAPI implements BlockchainApiInter const headerParameters: runtime.HTTPHeaders = {}; const response = await this.request({ - path: `/v2/blockchain/masterchain/{masterchain_seqno}/blocks`.replace(`{${"masterchain_seqno"}}`, encodeURIComponent(String(requestParameters.masterchainSeqno))), + path: `/v2/blockchain/masterchain/{masterchain_seqno}/blocks`.replace(`{${"masterchain_seqno"}}`, encodeURIComponent(String(requestParameters['masterchainSeqno']))), method: 'GET', headers: headerParameters, query: queryParameters, @@ -672,8 +712,11 @@ export class BlockchainApi extends runtime.BaseAPI implements BlockchainApiInter * Get blockchain block shards */ async getBlockchainMasterchainShardsRaw(requestParameters: GetBlockchainMasterchainShardsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.masterchainSeqno === null || requestParameters.masterchainSeqno === undefined) { - throw new runtime.RequiredError('masterchainSeqno','Required parameter requestParameters.masterchainSeqno was null or undefined when calling getBlockchainMasterchainShards.'); + if (requestParameters['masterchainSeqno'] == null) { + throw new runtime.RequiredError( + 'masterchainSeqno', + 'Required parameter "masterchainSeqno" was null or undefined when calling getBlockchainMasterchainShards().' + ); } const queryParameters: any = {}; @@ -681,7 +724,7 @@ export class BlockchainApi extends runtime.BaseAPI implements BlockchainApiInter const headerParameters: runtime.HTTPHeaders = {}; const response = await this.request({ - path: `/v2/blockchain/masterchain/{masterchain_seqno}/shards`.replace(`{${"masterchain_seqno"}}`, encodeURIComponent(String(requestParameters.masterchainSeqno))), + path: `/v2/blockchain/masterchain/{masterchain_seqno}/shards`.replace(`{${"masterchain_seqno"}}`, encodeURIComponent(String(requestParameters['masterchainSeqno']))), method: 'GET', headers: headerParameters, query: queryParameters, @@ -702,8 +745,11 @@ export class BlockchainApi extends runtime.BaseAPI implements BlockchainApiInter * Get all transactions in all shards and workchains between target and previous masterchain block according to shards last blocks snapshot in masterchain. We don\'t recommend to build your app around this method because it has problem with scalability and will work very slow in the future. */ async getBlockchainMasterchainTransactionsRaw(requestParameters: GetBlockchainMasterchainTransactionsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.masterchainSeqno === null || requestParameters.masterchainSeqno === undefined) { - throw new runtime.RequiredError('masterchainSeqno','Required parameter requestParameters.masterchainSeqno was null or undefined when calling getBlockchainMasterchainTransactions.'); + if (requestParameters['masterchainSeqno'] == null) { + throw new runtime.RequiredError( + 'masterchainSeqno', + 'Required parameter "masterchainSeqno" was null or undefined when calling getBlockchainMasterchainTransactions().' + ); } const queryParameters: any = {}; @@ -711,7 +757,7 @@ export class BlockchainApi extends runtime.BaseAPI implements BlockchainApiInter const headerParameters: runtime.HTTPHeaders = {}; const response = await this.request({ - path: `/v2/blockchain/masterchain/{masterchain_seqno}/transactions`.replace(`{${"masterchain_seqno"}}`, encodeURIComponent(String(requestParameters.masterchainSeqno))), + path: `/v2/blockchain/masterchain/{masterchain_seqno}/transactions`.replace(`{${"masterchain_seqno"}}`, encodeURIComponent(String(requestParameters['masterchainSeqno']))), method: 'GET', headers: headerParameters, query: queryParameters, @@ -732,8 +778,11 @@ export class BlockchainApi extends runtime.BaseAPI implements BlockchainApiInter * Get low-level information about an account taken directly from the blockchain. */ async getBlockchainRawAccountRaw(requestParameters: GetBlockchainRawAccountRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.accountId === null || requestParameters.accountId === undefined) { - throw new runtime.RequiredError('accountId','Required parameter requestParameters.accountId was null or undefined when calling getBlockchainRawAccount.'); + if (requestParameters['accountId'] == null) { + throw new runtime.RequiredError( + 'accountId', + 'Required parameter "accountId" was null or undefined when calling getBlockchainRawAccount().' + ); } const queryParameters: any = {}; @@ -741,7 +790,7 @@ export class BlockchainApi extends runtime.BaseAPI implements BlockchainApiInter const headerParameters: runtime.HTTPHeaders = {}; const response = await this.request({ - path: `/v2/blockchain/accounts/{account_id}`.replace(`{${"account_id"}}`, encodeURIComponent(String(requestParameters.accountId))), + path: `/v2/blockchain/accounts/{account_id}`.replace(`{${"account_id"}}`, encodeURIComponent(String(requestParameters['accountId']))), method: 'GET', headers: headerParameters, query: queryParameters, @@ -762,8 +811,11 @@ export class BlockchainApi extends runtime.BaseAPI implements BlockchainApiInter * Get transaction data */ async getBlockchainTransactionRaw(requestParameters: GetBlockchainTransactionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.transactionId === null || requestParameters.transactionId === undefined) { - throw new runtime.RequiredError('transactionId','Required parameter requestParameters.transactionId was null or undefined when calling getBlockchainTransaction.'); + if (requestParameters['transactionId'] == null) { + throw new runtime.RequiredError( + 'transactionId', + 'Required parameter "transactionId" was null or undefined when calling getBlockchainTransaction().' + ); } const queryParameters: any = {}; @@ -771,7 +823,7 @@ export class BlockchainApi extends runtime.BaseAPI implements BlockchainApiInter const headerParameters: runtime.HTTPHeaders = {}; const response = await this.request({ - path: `/v2/blockchain/transactions/{transaction_id}`.replace(`{${"transaction_id"}}`, encodeURIComponent(String(requestParameters.transactionId))), + path: `/v2/blockchain/transactions/{transaction_id}`.replace(`{${"transaction_id"}}`, encodeURIComponent(String(requestParameters['transactionId']))), method: 'GET', headers: headerParameters, query: queryParameters, @@ -792,8 +844,11 @@ export class BlockchainApi extends runtime.BaseAPI implements BlockchainApiInter * Get transaction data by message hash */ async getBlockchainTransactionByMessageHashRaw(requestParameters: GetBlockchainTransactionByMessageHashRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.msgId === null || requestParameters.msgId === undefined) { - throw new runtime.RequiredError('msgId','Required parameter requestParameters.msgId was null or undefined when calling getBlockchainTransactionByMessageHash.'); + if (requestParameters['msgId'] == null) { + throw new runtime.RequiredError( + 'msgId', + 'Required parameter "msgId" was null or undefined when calling getBlockchainTransactionByMessageHash().' + ); } const queryParameters: any = {}; @@ -801,7 +856,7 @@ export class BlockchainApi extends runtime.BaseAPI implements BlockchainApiInter const headerParameters: runtime.HTTPHeaders = {}; const response = await this.request({ - path: `/v2/blockchain/messages/{msg_id}/transaction`.replace(`{${"msg_id"}}`, encodeURIComponent(String(requestParameters.msgId))), + path: `/v2/blockchain/messages/{msg_id}/transaction`.replace(`{${"msg_id"}}`, encodeURIComponent(String(requestParameters['msgId']))), method: 'GET', headers: headerParameters, query: queryParameters, @@ -874,8 +929,11 @@ export class BlockchainApi extends runtime.BaseAPI implements BlockchainApiInter * Get raw blockchain config from a specific block, if present. */ async getRawBlockchainConfigFromBlockRaw(requestParameters: GetRawBlockchainConfigFromBlockRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.masterchainSeqno === null || requestParameters.masterchainSeqno === undefined) { - throw new runtime.RequiredError('masterchainSeqno','Required parameter requestParameters.masterchainSeqno was null or undefined when calling getRawBlockchainConfigFromBlock.'); + if (requestParameters['masterchainSeqno'] == null) { + throw new runtime.RequiredError( + 'masterchainSeqno', + 'Required parameter "masterchainSeqno" was null or undefined when calling getRawBlockchainConfigFromBlock().' + ); } const queryParameters: any = {}; @@ -883,7 +941,7 @@ export class BlockchainApi extends runtime.BaseAPI implements BlockchainApiInter const headerParameters: runtime.HTTPHeaders = {}; const response = await this.request({ - path: `/v2/blockchain/masterchain/{masterchain_seqno}/config/raw`.replace(`{${"masterchain_seqno"}}`, encodeURIComponent(String(requestParameters.masterchainSeqno))), + path: `/v2/blockchain/masterchain/{masterchain_seqno}/config/raw`.replace(`{${"masterchain_seqno"}}`, encodeURIComponent(String(requestParameters['masterchainSeqno']))), method: 'GET', headers: headerParameters, query: queryParameters, @@ -900,12 +958,41 @@ export class BlockchainApi extends runtime.BaseAPI implements BlockchainApiInter return await response.value(); } + /** + * Reduce indexing latency + */ + async reduceIndexingLatencyRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request({ + path: `/v2/status`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => ServiceStatusFromJSON(jsonValue)); + } + + /** + * Reduce indexing latency + */ + async reduceIndexingLatency(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.reduceIndexingLatencyRaw(initOverrides); + return await response.value(); + } + /** * Send message to blockchain */ async sendBlockchainMessageRaw(requestParameters: SendBlockchainMessageOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.sendBlockchainMessageRequest === null || requestParameters.sendBlockchainMessageRequest === undefined) { - throw new runtime.RequiredError('sendBlockchainMessageRequest','Required parameter requestParameters.sendBlockchainMessageRequest was null or undefined when calling sendBlockchainMessage.'); + if (requestParameters['sendBlockchainMessageRequest'] == null) { + throw new runtime.RequiredError( + 'sendBlockchainMessageRequest', + 'Required parameter "sendBlockchainMessageRequest" was null or undefined when calling sendBlockchainMessage().' + ); } const queryParameters: any = {}; @@ -919,7 +1006,7 @@ export class BlockchainApi extends runtime.BaseAPI implements BlockchainApiInter method: 'POST', headers: headerParameters, query: queryParameters, - body: SendBlockchainMessageRequestToJSON(requestParameters.sendBlockchainMessageRequest), + body: SendBlockchainMessageRequestToJSON(requestParameters['sendBlockchainMessageRequest']), }, initOverrides); return new runtime.VoidApiResponse(response); diff --git a/packages/core/src/tonApiV2/apis/ConnectApi.ts b/packages/core/src/tonApiV2/apis/ConnectApi.ts index 772a23072..fe8110185 100644 --- a/packages/core/src/tonApiV2/apis/ConnectApi.ts +++ b/packages/core/src/tonApiV2/apis/ConnectApi.ts @@ -17,18 +17,18 @@ import * as runtime from '../runtime'; import type { AccountInfoByStateInit, GetAccountInfoByStateInitRequest, - GetBlockchainBlockDefaultResponse, GetTonConnectPayload200Response, + ReduceIndexingLatencyDefaultResponse, } from '../models/index'; import { AccountInfoByStateInitFromJSON, AccountInfoByStateInitToJSON, GetAccountInfoByStateInitRequestFromJSON, GetAccountInfoByStateInitRequestToJSON, - GetBlockchainBlockDefaultResponseFromJSON, - GetBlockchainBlockDefaultResponseToJSON, GetTonConnectPayload200ResponseFromJSON, GetTonConnectPayload200ResponseToJSON, + ReduceIndexingLatencyDefaultResponseFromJSON, + ReduceIndexingLatencyDefaultResponseToJSON, } from '../models/index'; export interface GetAccountInfoByStateInitOperationRequest { @@ -80,8 +80,11 @@ export class ConnectApi extends runtime.BaseAPI implements ConnectApiInterface { * Get account info by state init */ async getAccountInfoByStateInitRaw(requestParameters: GetAccountInfoByStateInitOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.getAccountInfoByStateInitRequest === null || requestParameters.getAccountInfoByStateInitRequest === undefined) { - throw new runtime.RequiredError('getAccountInfoByStateInitRequest','Required parameter requestParameters.getAccountInfoByStateInitRequest was null or undefined when calling getAccountInfoByStateInit.'); + if (requestParameters['getAccountInfoByStateInitRequest'] == null) { + throw new runtime.RequiredError( + 'getAccountInfoByStateInitRequest', + 'Required parameter "getAccountInfoByStateInitRequest" was null or undefined when calling getAccountInfoByStateInit().' + ); } const queryParameters: any = {}; @@ -95,7 +98,7 @@ export class ConnectApi extends runtime.BaseAPI implements ConnectApiInterface { method: 'POST', headers: headerParameters, query: queryParameters, - body: GetAccountInfoByStateInitRequestToJSON(requestParameters.getAccountInfoByStateInitRequest), + body: GetAccountInfoByStateInitRequestToJSON(requestParameters['getAccountInfoByStateInitRequest']), }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => AccountInfoByStateInitFromJSON(jsonValue)); diff --git a/packages/core/src/tonApiV2/apis/DNSApi.ts b/packages/core/src/tonApiV2/apis/DNSApi.ts index ef47c8bc3..1453358ff 100644 --- a/packages/core/src/tonApiV2/apis/DNSApi.ts +++ b/packages/core/src/tonApiV2/apis/DNSApi.ts @@ -19,7 +19,7 @@ import type { DnsRecord, DomainBids, DomainInfo, - GetBlockchainBlockDefaultResponse, + ReduceIndexingLatencyDefaultResponse, } from '../models/index'; import { AuctionsFromJSON, @@ -30,8 +30,8 @@ import { DomainBidsToJSON, DomainInfoFromJSON, DomainInfoToJSON, - GetBlockchainBlockDefaultResponseFromJSON, - GetBlockchainBlockDefaultResponseToJSON, + ReduceIndexingLatencyDefaultResponseFromJSON, + ReduceIndexingLatencyDefaultResponseToJSON, } from '../models/index'; export interface DnsResolveRequest { @@ -124,8 +124,11 @@ export class DNSApi extends runtime.BaseAPI implements DNSApiInterface { * DNS resolve for domain name */ async dnsResolveRaw(requestParameters: DnsResolveRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.domainName === null || requestParameters.domainName === undefined) { - throw new runtime.RequiredError('domainName','Required parameter requestParameters.domainName was null or undefined when calling dnsResolve.'); + if (requestParameters['domainName'] == null) { + throw new runtime.RequiredError( + 'domainName', + 'Required parameter "domainName" was null or undefined when calling dnsResolve().' + ); } const queryParameters: any = {}; @@ -133,7 +136,7 @@ export class DNSApi extends runtime.BaseAPI implements DNSApiInterface { const headerParameters: runtime.HTTPHeaders = {}; const response = await this.request({ - path: `/v2/dns/{domain_name}/resolve`.replace(`{${"domain_name"}}`, encodeURIComponent(String(requestParameters.domainName))), + path: `/v2/dns/{domain_name}/resolve`.replace(`{${"domain_name"}}`, encodeURIComponent(String(requestParameters['domainName']))), method: 'GET', headers: headerParameters, query: queryParameters, @@ -156,8 +159,8 @@ export class DNSApi extends runtime.BaseAPI implements DNSApiInterface { async getAllAuctionsRaw(requestParameters: GetAllAuctionsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { const queryParameters: any = {}; - if (requestParameters.tld !== undefined) { - queryParameters['tld'] = requestParameters.tld; + if (requestParameters['tld'] != null) { + queryParameters['tld'] = requestParameters['tld']; } const headerParameters: runtime.HTTPHeaders = {}; @@ -184,8 +187,11 @@ export class DNSApi extends runtime.BaseAPI implements DNSApiInterface { * Get full information about domain name */ async getDnsInfoRaw(requestParameters: GetDnsInfoRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.domainName === null || requestParameters.domainName === undefined) { - throw new runtime.RequiredError('domainName','Required parameter requestParameters.domainName was null or undefined when calling getDnsInfo.'); + if (requestParameters['domainName'] == null) { + throw new runtime.RequiredError( + 'domainName', + 'Required parameter "domainName" was null or undefined when calling getDnsInfo().' + ); } const queryParameters: any = {}; @@ -193,7 +199,7 @@ export class DNSApi extends runtime.BaseAPI implements DNSApiInterface { const headerParameters: runtime.HTTPHeaders = {}; const response = await this.request({ - path: `/v2/dns/{domain_name}`.replace(`{${"domain_name"}}`, encodeURIComponent(String(requestParameters.domainName))), + path: `/v2/dns/{domain_name}`.replace(`{${"domain_name"}}`, encodeURIComponent(String(requestParameters['domainName']))), method: 'GET', headers: headerParameters, query: queryParameters, @@ -214,8 +220,11 @@ export class DNSApi extends runtime.BaseAPI implements DNSApiInterface { * Get domain bids */ async getDomainBidsRaw(requestParameters: GetDomainBidsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.domainName === null || requestParameters.domainName === undefined) { - throw new runtime.RequiredError('domainName','Required parameter requestParameters.domainName was null or undefined when calling getDomainBids.'); + if (requestParameters['domainName'] == null) { + throw new runtime.RequiredError( + 'domainName', + 'Required parameter "domainName" was null or undefined when calling getDomainBids().' + ); } const queryParameters: any = {}; @@ -223,7 +232,7 @@ export class DNSApi extends runtime.BaseAPI implements DNSApiInterface { const headerParameters: runtime.HTTPHeaders = {}; const response = await this.request({ - path: `/v2/dns/{domain_name}/bids`.replace(`{${"domain_name"}}`, encodeURIComponent(String(requestParameters.domainName))), + path: `/v2/dns/{domain_name}/bids`.replace(`{${"domain_name"}}`, encodeURIComponent(String(requestParameters['domainName']))), method: 'GET', headers: headerParameters, query: queryParameters, diff --git a/packages/core/src/tonApiV2/apis/EmulationApi.ts b/packages/core/src/tonApiV2/apis/EmulationApi.ts index d7790f0a2..ad9a4c9c3 100644 --- a/packages/core/src/tonApiV2/apis/EmulationApi.ts +++ b/packages/core/src/tonApiV2/apis/EmulationApi.ts @@ -20,8 +20,8 @@ import type { DecodedMessage, EmulateMessageToWalletRequest, Event, - GetBlockchainBlockDefaultResponse, MessageConsequences, + ReduceIndexingLatencyDefaultResponse, Trace, } from '../models/index'; import { @@ -35,10 +35,10 @@ import { EmulateMessageToWalletRequestToJSON, EventFromJSON, EventToJSON, - GetBlockchainBlockDefaultResponseFromJSON, - GetBlockchainBlockDefaultResponseToJSON, MessageConsequencesFromJSON, MessageConsequencesToJSON, + ReduceIndexingLatencyDefaultResponseFromJSON, + ReduceIndexingLatencyDefaultResponseToJSON, TraceFromJSON, TraceToJSON, } from '../models/index'; @@ -51,6 +51,7 @@ export interface EmulateMessageToAccountEventRequest { accountId: string; decodeMessageRequest: DecodeMessageRequest; acceptLanguage?: string; + ignoreSignatureCheck?: boolean; } export interface EmulateMessageToEventRequest { @@ -95,6 +96,7 @@ export interface EmulationApiInterface { * @param {string} accountId account ID * @param {DecodeMessageRequest} decodeMessageRequest bag-of-cells serialized to base64 * @param {string} [acceptLanguage] + * @param {boolean} [ignoreSignatureCheck] * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof EmulationApiInterface @@ -163,8 +165,11 @@ export class EmulationApi extends runtime.BaseAPI implements EmulationApiInterfa * Decode a given message. Only external incoming messages can be decoded currently. */ async decodeMessageRaw(requestParameters: DecodeMessageOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.decodeMessageRequest === null || requestParameters.decodeMessageRequest === undefined) { - throw new runtime.RequiredError('decodeMessageRequest','Required parameter requestParameters.decodeMessageRequest was null or undefined when calling decodeMessage.'); + if (requestParameters['decodeMessageRequest'] == null) { + throw new runtime.RequiredError( + 'decodeMessageRequest', + 'Required parameter "decodeMessageRequest" was null or undefined when calling decodeMessage().' + ); } const queryParameters: any = {}; @@ -178,7 +183,7 @@ export class EmulationApi extends runtime.BaseAPI implements EmulationApiInterfa method: 'POST', headers: headerParameters, query: queryParameters, - body: DecodeMessageRequestToJSON(requestParameters.decodeMessageRequest), + body: DecodeMessageRequestToJSON(requestParameters['decodeMessageRequest']), }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => DecodedMessageFromJSON(jsonValue)); @@ -196,30 +201,40 @@ export class EmulationApi extends runtime.BaseAPI implements EmulationApiInterfa * Emulate sending message to blockchain */ async emulateMessageToAccountEventRaw(requestParameters: EmulateMessageToAccountEventRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.accountId === null || requestParameters.accountId === undefined) { - throw new runtime.RequiredError('accountId','Required parameter requestParameters.accountId was null or undefined when calling emulateMessageToAccountEvent.'); + if (requestParameters['accountId'] == null) { + throw new runtime.RequiredError( + 'accountId', + 'Required parameter "accountId" was null or undefined when calling emulateMessageToAccountEvent().' + ); } - if (requestParameters.decodeMessageRequest === null || requestParameters.decodeMessageRequest === undefined) { - throw new runtime.RequiredError('decodeMessageRequest','Required parameter requestParameters.decodeMessageRequest was null or undefined when calling emulateMessageToAccountEvent.'); + if (requestParameters['decodeMessageRequest'] == null) { + throw new runtime.RequiredError( + 'decodeMessageRequest', + 'Required parameter "decodeMessageRequest" was null or undefined when calling emulateMessageToAccountEvent().' + ); } const queryParameters: any = {}; + if (requestParameters['ignoreSignatureCheck'] != null) { + queryParameters['ignore_signature_check'] = requestParameters['ignoreSignatureCheck']; + } + const headerParameters: runtime.HTTPHeaders = {}; headerParameters['Content-Type'] = 'application/json'; - if (requestParameters.acceptLanguage !== undefined && requestParameters.acceptLanguage !== null) { - headerParameters['Accept-Language'] = String(requestParameters.acceptLanguage); + if (requestParameters['acceptLanguage'] != null) { + headerParameters['Accept-Language'] = String(requestParameters['acceptLanguage']); } const response = await this.request({ - path: `/v2/accounts/{account_id}/events/emulate`.replace(`{${"account_id"}}`, encodeURIComponent(String(requestParameters.accountId))), + path: `/v2/accounts/{account_id}/events/emulate`.replace(`{${"account_id"}}`, encodeURIComponent(String(requestParameters['accountId']))), method: 'POST', headers: headerParameters, query: queryParameters, - body: DecodeMessageRequestToJSON(requestParameters.decodeMessageRequest), + body: DecodeMessageRequestToJSON(requestParameters['decodeMessageRequest']), }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => AccountEventFromJSON(jsonValue)); @@ -237,22 +252,25 @@ export class EmulationApi extends runtime.BaseAPI implements EmulationApiInterfa * Emulate sending message to blockchain */ async emulateMessageToEventRaw(requestParameters: EmulateMessageToEventRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.decodeMessageRequest === null || requestParameters.decodeMessageRequest === undefined) { - throw new runtime.RequiredError('decodeMessageRequest','Required parameter requestParameters.decodeMessageRequest was null or undefined when calling emulateMessageToEvent.'); + if (requestParameters['decodeMessageRequest'] == null) { + throw new runtime.RequiredError( + 'decodeMessageRequest', + 'Required parameter "decodeMessageRequest" was null or undefined when calling emulateMessageToEvent().' + ); } const queryParameters: any = {}; - if (requestParameters.ignoreSignatureCheck !== undefined) { - queryParameters['ignore_signature_check'] = requestParameters.ignoreSignatureCheck; + if (requestParameters['ignoreSignatureCheck'] != null) { + queryParameters['ignore_signature_check'] = requestParameters['ignoreSignatureCheck']; } const headerParameters: runtime.HTTPHeaders = {}; headerParameters['Content-Type'] = 'application/json'; - if (requestParameters.acceptLanguage !== undefined && requestParameters.acceptLanguage !== null) { - headerParameters['Accept-Language'] = String(requestParameters.acceptLanguage); + if (requestParameters['acceptLanguage'] != null) { + headerParameters['Accept-Language'] = String(requestParameters['acceptLanguage']); } const response = await this.request({ @@ -260,7 +278,7 @@ export class EmulationApi extends runtime.BaseAPI implements EmulationApiInterfa method: 'POST', headers: headerParameters, query: queryParameters, - body: DecodeMessageRequestToJSON(requestParameters.decodeMessageRequest), + body: DecodeMessageRequestToJSON(requestParameters['decodeMessageRequest']), }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => EventFromJSON(jsonValue)); @@ -278,14 +296,17 @@ export class EmulationApi extends runtime.BaseAPI implements EmulationApiInterfa * Emulate sending message to blockchain */ async emulateMessageToTraceRaw(requestParameters: EmulateMessageToTraceRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.decodeMessageRequest === null || requestParameters.decodeMessageRequest === undefined) { - throw new runtime.RequiredError('decodeMessageRequest','Required parameter requestParameters.decodeMessageRequest was null or undefined when calling emulateMessageToTrace.'); + if (requestParameters['decodeMessageRequest'] == null) { + throw new runtime.RequiredError( + 'decodeMessageRequest', + 'Required parameter "decodeMessageRequest" was null or undefined when calling emulateMessageToTrace().' + ); } const queryParameters: any = {}; - if (requestParameters.ignoreSignatureCheck !== undefined) { - queryParameters['ignore_signature_check'] = requestParameters.ignoreSignatureCheck; + if (requestParameters['ignoreSignatureCheck'] != null) { + queryParameters['ignore_signature_check'] = requestParameters['ignoreSignatureCheck']; } const headerParameters: runtime.HTTPHeaders = {}; @@ -297,7 +318,7 @@ export class EmulationApi extends runtime.BaseAPI implements EmulationApiInterfa method: 'POST', headers: headerParameters, query: queryParameters, - body: DecodeMessageRequestToJSON(requestParameters.decodeMessageRequest), + body: DecodeMessageRequestToJSON(requestParameters['decodeMessageRequest']), }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => TraceFromJSON(jsonValue)); @@ -315,8 +336,11 @@ export class EmulationApi extends runtime.BaseAPI implements EmulationApiInterfa * Emulate sending message to blockchain */ async emulateMessageToWalletRaw(requestParameters: EmulateMessageToWalletOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.emulateMessageToWalletRequest === null || requestParameters.emulateMessageToWalletRequest === undefined) { - throw new runtime.RequiredError('emulateMessageToWalletRequest','Required parameter requestParameters.emulateMessageToWalletRequest was null or undefined when calling emulateMessageToWallet.'); + if (requestParameters['emulateMessageToWalletRequest'] == null) { + throw new runtime.RequiredError( + 'emulateMessageToWalletRequest', + 'Required parameter "emulateMessageToWalletRequest" was null or undefined when calling emulateMessageToWallet().' + ); } const queryParameters: any = {}; @@ -325,8 +349,8 @@ export class EmulationApi extends runtime.BaseAPI implements EmulationApiInterfa headerParameters['Content-Type'] = 'application/json'; - if (requestParameters.acceptLanguage !== undefined && requestParameters.acceptLanguage !== null) { - headerParameters['Accept-Language'] = String(requestParameters.acceptLanguage); + if (requestParameters['acceptLanguage'] != null) { + headerParameters['Accept-Language'] = String(requestParameters['acceptLanguage']); } const response = await this.request({ @@ -334,7 +358,7 @@ export class EmulationApi extends runtime.BaseAPI implements EmulationApiInterfa method: 'POST', headers: headerParameters, query: queryParameters, - body: EmulateMessageToWalletRequestToJSON(requestParameters.emulateMessageToWalletRequest), + body: EmulateMessageToWalletRequestToJSON(requestParameters['emulateMessageToWalletRequest']), }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => MessageConsequencesFromJSON(jsonValue)); diff --git a/packages/core/src/tonApiV2/apis/EventsApi.ts b/packages/core/src/tonApiV2/apis/EventsApi.ts index 9e79d5dbb..0077fcce1 100644 --- a/packages/core/src/tonApiV2/apis/EventsApi.ts +++ b/packages/core/src/tonApiV2/apis/EventsApi.ts @@ -16,13 +16,13 @@ import * as runtime from '../runtime'; import type { Event, - GetBlockchainBlockDefaultResponse, + ReduceIndexingLatencyDefaultResponse, } from '../models/index'; import { EventFromJSON, EventToJSON, - GetBlockchainBlockDefaultResponseFromJSON, - GetBlockchainBlockDefaultResponseToJSON, + ReduceIndexingLatencyDefaultResponseFromJSON, + ReduceIndexingLatencyDefaultResponseToJSON, } from '../models/index'; export interface GetEventRequest { @@ -63,20 +63,23 @@ export class EventsApi extends runtime.BaseAPI implements EventsApiInterface { * Get an event either by event ID or a hash of any transaction in a trace. An event is built on top of a trace which is a series of transactions caused by one inbound message. TonAPI looks for known patterns inside the trace and splits the trace into actions, where a single action represents a meaningful high-level operation like a Jetton Transfer or an NFT Purchase. Actions are expected to be shown to users. It is advised not to build any logic on top of actions because actions can be changed at any time. */ async getEventRaw(requestParameters: GetEventRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.eventId === null || requestParameters.eventId === undefined) { - throw new runtime.RequiredError('eventId','Required parameter requestParameters.eventId was null or undefined when calling getEvent.'); + if (requestParameters['eventId'] == null) { + throw new runtime.RequiredError( + 'eventId', + 'Required parameter "eventId" was null or undefined when calling getEvent().' + ); } const queryParameters: any = {}; const headerParameters: runtime.HTTPHeaders = {}; - if (requestParameters.acceptLanguage !== undefined && requestParameters.acceptLanguage !== null) { - headerParameters['Accept-Language'] = String(requestParameters.acceptLanguage); + if (requestParameters['acceptLanguage'] != null) { + headerParameters['Accept-Language'] = String(requestParameters['acceptLanguage']); } const response = await this.request({ - path: `/v2/events/{event_id}`.replace(`{${"event_id"}}`, encodeURIComponent(String(requestParameters.eventId))), + path: `/v2/events/{event_id}`.replace(`{${"event_id"}}`, encodeURIComponent(String(requestParameters['eventId']))), method: 'GET', headers: headerParameters, query: queryParameters, diff --git a/packages/core/src/tonApiV2/apis/InscriptionsApi.ts b/packages/core/src/tonApiV2/apis/InscriptionsApi.ts index f63d4f18f..7cdb53897 100644 --- a/packages/core/src/tonApiV2/apis/InscriptionsApi.ts +++ b/packages/core/src/tonApiV2/apis/InscriptionsApi.ts @@ -16,19 +16,19 @@ import * as runtime from '../runtime'; import type { AccountEvents, - GetBlockchainBlockDefaultResponse, GetInscriptionOpTemplate200Response, InscriptionBalances, + ReduceIndexingLatencyDefaultResponse, } from '../models/index'; import { AccountEventsFromJSON, AccountEventsToJSON, - GetBlockchainBlockDefaultResponseFromJSON, - GetBlockchainBlockDefaultResponseToJSON, GetInscriptionOpTemplate200ResponseFromJSON, GetInscriptionOpTemplate200ResponseToJSON, InscriptionBalancesFromJSON, InscriptionBalancesToJSON, + ReduceIndexingLatencyDefaultResponseFromJSON, + ReduceIndexingLatencyDefaultResponseToJSON, } from '../models/index'; export interface GetAccountInscriptionsRequest { @@ -151,24 +151,27 @@ export class InscriptionsApi extends runtime.BaseAPI implements InscriptionsApiI * Get all inscriptions by owner address. It\'s experimental API and can be dropped in the future. */ async getAccountInscriptionsRaw(requestParameters: GetAccountInscriptionsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.accountId === null || requestParameters.accountId === undefined) { - throw new runtime.RequiredError('accountId','Required parameter requestParameters.accountId was null or undefined when calling getAccountInscriptions.'); + if (requestParameters['accountId'] == null) { + throw new runtime.RequiredError( + 'accountId', + 'Required parameter "accountId" was null or undefined when calling getAccountInscriptions().' + ); } const queryParameters: any = {}; - if (requestParameters.limit !== undefined) { - queryParameters['limit'] = requestParameters.limit; + if (requestParameters['limit'] != null) { + queryParameters['limit'] = requestParameters['limit']; } - if (requestParameters.offset !== undefined) { - queryParameters['offset'] = requestParameters.offset; + if (requestParameters['offset'] != null) { + queryParameters['offset'] = requestParameters['offset']; } const headerParameters: runtime.HTTPHeaders = {}; const response = await this.request({ - path: `/v2/experimental/accounts/{account_id}/inscriptions`.replace(`{${"account_id"}}`, encodeURIComponent(String(requestParameters.accountId))), + path: `/v2/experimental/accounts/{account_id}/inscriptions`.replace(`{${"account_id"}}`, encodeURIComponent(String(requestParameters['accountId']))), method: 'GET', headers: headerParameters, query: queryParameters, @@ -189,28 +192,31 @@ export class InscriptionsApi extends runtime.BaseAPI implements InscriptionsApiI * Get the transfer inscriptions history for account. It\'s experimental API and can be dropped in the future. */ async getAccountInscriptionsHistoryRaw(requestParameters: GetAccountInscriptionsHistoryRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.accountId === null || requestParameters.accountId === undefined) { - throw new runtime.RequiredError('accountId','Required parameter requestParameters.accountId was null or undefined when calling getAccountInscriptionsHistory.'); + if (requestParameters['accountId'] == null) { + throw new runtime.RequiredError( + 'accountId', + 'Required parameter "accountId" was null or undefined when calling getAccountInscriptionsHistory().' + ); } const queryParameters: any = {}; - if (requestParameters.beforeLt !== undefined) { - queryParameters['before_lt'] = requestParameters.beforeLt; + if (requestParameters['beforeLt'] != null) { + queryParameters['before_lt'] = requestParameters['beforeLt']; } - if (requestParameters.limit !== undefined) { - queryParameters['limit'] = requestParameters.limit; + if (requestParameters['limit'] != null) { + queryParameters['limit'] = requestParameters['limit']; } const headerParameters: runtime.HTTPHeaders = {}; - if (requestParameters.acceptLanguage !== undefined && requestParameters.acceptLanguage !== null) { - headerParameters['Accept-Language'] = String(requestParameters.acceptLanguage); + if (requestParameters['acceptLanguage'] != null) { + headerParameters['Accept-Language'] = String(requestParameters['acceptLanguage']); } const response = await this.request({ - path: `/v2/experimental/accounts/{account_id}/inscriptions/history`.replace(`{${"account_id"}}`, encodeURIComponent(String(requestParameters.accountId))), + path: `/v2/experimental/accounts/{account_id}/inscriptions/history`.replace(`{${"account_id"}}`, encodeURIComponent(String(requestParameters['accountId']))), method: 'GET', headers: headerParameters, query: queryParameters, @@ -231,32 +237,38 @@ export class InscriptionsApi extends runtime.BaseAPI implements InscriptionsApiI * Get the transfer inscriptions history for account. It\'s experimental API and can be dropped in the future. */ async getAccountInscriptionsHistoryByTickerRaw(requestParameters: GetAccountInscriptionsHistoryByTickerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.accountId === null || requestParameters.accountId === undefined) { - throw new runtime.RequiredError('accountId','Required parameter requestParameters.accountId was null or undefined when calling getAccountInscriptionsHistoryByTicker.'); + if (requestParameters['accountId'] == null) { + throw new runtime.RequiredError( + 'accountId', + 'Required parameter "accountId" was null or undefined when calling getAccountInscriptionsHistoryByTicker().' + ); } - if (requestParameters.ticker === null || requestParameters.ticker === undefined) { - throw new runtime.RequiredError('ticker','Required parameter requestParameters.ticker was null or undefined when calling getAccountInscriptionsHistoryByTicker.'); + if (requestParameters['ticker'] == null) { + throw new runtime.RequiredError( + 'ticker', + 'Required parameter "ticker" was null or undefined when calling getAccountInscriptionsHistoryByTicker().' + ); } const queryParameters: any = {}; - if (requestParameters.beforeLt !== undefined) { - queryParameters['before_lt'] = requestParameters.beforeLt; + if (requestParameters['beforeLt'] != null) { + queryParameters['before_lt'] = requestParameters['beforeLt']; } - if (requestParameters.limit !== undefined) { - queryParameters['limit'] = requestParameters.limit; + if (requestParameters['limit'] != null) { + queryParameters['limit'] = requestParameters['limit']; } const headerParameters: runtime.HTTPHeaders = {}; - if (requestParameters.acceptLanguage !== undefined && requestParameters.acceptLanguage !== null) { - headerParameters['Accept-Language'] = String(requestParameters.acceptLanguage); + if (requestParameters['acceptLanguage'] != null) { + headerParameters['Accept-Language'] = String(requestParameters['acceptLanguage']); } const response = await this.request({ - path: `/v2/experimental/accounts/{account_id}/inscriptions/{ticker}/history`.replace(`{${"account_id"}}`, encodeURIComponent(String(requestParameters.accountId))).replace(`{${"ticker"}}`, encodeURIComponent(String(requestParameters.ticker))), + path: `/v2/experimental/accounts/{account_id}/inscriptions/{ticker}/history`.replace(`{${"account_id"}}`, encodeURIComponent(String(requestParameters['accountId']))).replace(`{${"ticker"}}`, encodeURIComponent(String(requestParameters['ticker']))), method: 'GET', headers: headerParameters, query: queryParameters, @@ -277,54 +289,69 @@ export class InscriptionsApi extends runtime.BaseAPI implements InscriptionsApiI * return comment for making operation with inscription. please don\'t use it if you don\'t know what you are doing */ async getInscriptionOpTemplateRaw(requestParameters: GetInscriptionOpTemplateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.type === null || requestParameters.type === undefined) { - throw new runtime.RequiredError('type','Required parameter requestParameters.type was null or undefined when calling getInscriptionOpTemplate.'); + if (requestParameters['type'] == null) { + throw new runtime.RequiredError( + 'type', + 'Required parameter "type" was null or undefined when calling getInscriptionOpTemplate().' + ); } - if (requestParameters.operation === null || requestParameters.operation === undefined) { - throw new runtime.RequiredError('operation','Required parameter requestParameters.operation was null or undefined when calling getInscriptionOpTemplate.'); + if (requestParameters['operation'] == null) { + throw new runtime.RequiredError( + 'operation', + 'Required parameter "operation" was null or undefined when calling getInscriptionOpTemplate().' + ); } - if (requestParameters.amount === null || requestParameters.amount === undefined) { - throw new runtime.RequiredError('amount','Required parameter requestParameters.amount was null or undefined when calling getInscriptionOpTemplate.'); + if (requestParameters['amount'] == null) { + throw new runtime.RequiredError( + 'amount', + 'Required parameter "amount" was null or undefined when calling getInscriptionOpTemplate().' + ); } - if (requestParameters.ticker === null || requestParameters.ticker === undefined) { - throw new runtime.RequiredError('ticker','Required parameter requestParameters.ticker was null or undefined when calling getInscriptionOpTemplate.'); + if (requestParameters['ticker'] == null) { + throw new runtime.RequiredError( + 'ticker', + 'Required parameter "ticker" was null or undefined when calling getInscriptionOpTemplate().' + ); } - if (requestParameters.who === null || requestParameters.who === undefined) { - throw new runtime.RequiredError('who','Required parameter requestParameters.who was null or undefined when calling getInscriptionOpTemplate.'); + if (requestParameters['who'] == null) { + throw new runtime.RequiredError( + 'who', + 'Required parameter "who" was null or undefined when calling getInscriptionOpTemplate().' + ); } const queryParameters: any = {}; - if (requestParameters.type !== undefined) { - queryParameters['type'] = requestParameters.type; + if (requestParameters['type'] != null) { + queryParameters['type'] = requestParameters['type']; } - if (requestParameters.destination !== undefined) { - queryParameters['destination'] = requestParameters.destination; + if (requestParameters['destination'] != null) { + queryParameters['destination'] = requestParameters['destination']; } - if (requestParameters.comment !== undefined) { - queryParameters['comment'] = requestParameters.comment; + if (requestParameters['comment'] != null) { + queryParameters['comment'] = requestParameters['comment']; } - if (requestParameters.operation !== undefined) { - queryParameters['operation'] = requestParameters.operation; + if (requestParameters['operation'] != null) { + queryParameters['operation'] = requestParameters['operation']; } - if (requestParameters.amount !== undefined) { - queryParameters['amount'] = requestParameters.amount; + if (requestParameters['amount'] != null) { + queryParameters['amount'] = requestParameters['amount']; } - if (requestParameters.ticker !== undefined) { - queryParameters['ticker'] = requestParameters.ticker; + if (requestParameters['ticker'] != null) { + queryParameters['ticker'] = requestParameters['ticker']; } - if (requestParameters.who !== undefined) { - queryParameters['who'] = requestParameters.who; + if (requestParameters['who'] != null) { + queryParameters['who'] = requestParameters['who']; } const headerParameters: runtime.HTTPHeaders = {}; diff --git a/packages/core/src/tonApiV2/apis/JettonsApi.ts b/packages/core/src/tonApiV2/apis/JettonsApi.ts index 11b0f776c..c7b86be03 100644 --- a/packages/core/src/tonApiV2/apis/JettonsApi.ts +++ b/packages/core/src/tonApiV2/apis/JettonsApi.ts @@ -16,22 +16,22 @@ import * as runtime from '../runtime'; import type { Event, - GetBlockchainBlockDefaultResponse, JettonHolders, JettonInfo, Jettons, + ReduceIndexingLatencyDefaultResponse, } from '../models/index'; import { EventFromJSON, EventToJSON, - GetBlockchainBlockDefaultResponseFromJSON, - GetBlockchainBlockDefaultResponseToJSON, JettonHoldersFromJSON, JettonHoldersToJSON, JettonInfoFromJSON, JettonInfoToJSON, JettonsFromJSON, JettonsToJSON, + ReduceIndexingLatencyDefaultResponseFromJSON, + ReduceIndexingLatencyDefaultResponseToJSON, } from '../models/index'; export interface GetJettonHoldersRequest { @@ -132,24 +132,27 @@ export class JettonsApi extends runtime.BaseAPI implements JettonsApiInterface { * Get jetton\'s holders */ async getJettonHoldersRaw(requestParameters: GetJettonHoldersRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.accountId === null || requestParameters.accountId === undefined) { - throw new runtime.RequiredError('accountId','Required parameter requestParameters.accountId was null or undefined when calling getJettonHolders.'); + if (requestParameters['accountId'] == null) { + throw new runtime.RequiredError( + 'accountId', + 'Required parameter "accountId" was null or undefined when calling getJettonHolders().' + ); } const queryParameters: any = {}; - if (requestParameters.limit !== undefined) { - queryParameters['limit'] = requestParameters.limit; + if (requestParameters['limit'] != null) { + queryParameters['limit'] = requestParameters['limit']; } - if (requestParameters.offset !== undefined) { - queryParameters['offset'] = requestParameters.offset; + if (requestParameters['offset'] != null) { + queryParameters['offset'] = requestParameters['offset']; } const headerParameters: runtime.HTTPHeaders = {}; const response = await this.request({ - path: `/v2/jettons/{account_id}/holders`.replace(`{${"account_id"}}`, encodeURIComponent(String(requestParameters.accountId))), + path: `/v2/jettons/{account_id}/holders`.replace(`{${"account_id"}}`, encodeURIComponent(String(requestParameters['accountId']))), method: 'GET', headers: headerParameters, query: queryParameters, @@ -170,8 +173,11 @@ export class JettonsApi extends runtime.BaseAPI implements JettonsApiInterface { * Get jetton metadata by jetton master address */ async getJettonInfoRaw(requestParameters: GetJettonInfoRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.accountId === null || requestParameters.accountId === undefined) { - throw new runtime.RequiredError('accountId','Required parameter requestParameters.accountId was null or undefined when calling getJettonInfo.'); + if (requestParameters['accountId'] == null) { + throw new runtime.RequiredError( + 'accountId', + 'Required parameter "accountId" was null or undefined when calling getJettonInfo().' + ); } const queryParameters: any = {}; @@ -179,7 +185,7 @@ export class JettonsApi extends runtime.BaseAPI implements JettonsApiInterface { const headerParameters: runtime.HTTPHeaders = {}; const response = await this.request({ - path: `/v2/jettons/{account_id}`.replace(`{${"account_id"}}`, encodeURIComponent(String(requestParameters.accountId))), + path: `/v2/jettons/{account_id}`.replace(`{${"account_id"}}`, encodeURIComponent(String(requestParameters['accountId']))), method: 'GET', headers: headerParameters, query: queryParameters, @@ -202,12 +208,12 @@ export class JettonsApi extends runtime.BaseAPI implements JettonsApiInterface { async getJettonsRaw(requestParameters: GetJettonsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { const queryParameters: any = {}; - if (requestParameters.limit !== undefined) { - queryParameters['limit'] = requestParameters.limit; + if (requestParameters['limit'] != null) { + queryParameters['limit'] = requestParameters['limit']; } - if (requestParameters.offset !== undefined) { - queryParameters['offset'] = requestParameters.offset; + if (requestParameters['offset'] != null) { + queryParameters['offset'] = requestParameters['offset']; } const headerParameters: runtime.HTTPHeaders = {}; @@ -234,20 +240,23 @@ export class JettonsApi extends runtime.BaseAPI implements JettonsApiInterface { * Get only jetton transfers in the event */ async getJettonsEventsRaw(requestParameters: GetJettonsEventsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.eventId === null || requestParameters.eventId === undefined) { - throw new runtime.RequiredError('eventId','Required parameter requestParameters.eventId was null or undefined when calling getJettonsEvents.'); + if (requestParameters['eventId'] == null) { + throw new runtime.RequiredError( + 'eventId', + 'Required parameter "eventId" was null or undefined when calling getJettonsEvents().' + ); } const queryParameters: any = {}; const headerParameters: runtime.HTTPHeaders = {}; - if (requestParameters.acceptLanguage !== undefined && requestParameters.acceptLanguage !== null) { - headerParameters['Accept-Language'] = String(requestParameters.acceptLanguage); + if (requestParameters['acceptLanguage'] != null) { + headerParameters['Accept-Language'] = String(requestParameters['acceptLanguage']); } const response = await this.request({ - path: `/v2/events/{event_id}/jettons`.replace(`{${"event_id"}}`, encodeURIComponent(String(requestParameters.eventId))), + path: `/v2/events/{event_id}/jettons`.replace(`{${"event_id"}}`, encodeURIComponent(String(requestParameters['eventId']))), method: 'GET', headers: headerParameters, query: queryParameters, diff --git a/packages/core/src/tonApiV2/apis/LiteServerApi.ts b/packages/core/src/tonApiV2/apis/LiteServerApi.ts index 51cbf8496..4e15d3cbc 100644 --- a/packages/core/src/tonApiV2/apis/LiteServerApi.ts +++ b/packages/core/src/tonApiV2/apis/LiteServerApi.ts @@ -16,7 +16,6 @@ import * as runtime from '../runtime'; import type { GetAllRawShardsInfo200Response, - GetBlockchainBlockDefaultResponse, GetRawAccountState200Response, GetRawBlockProof200Response, GetRawBlockchainBlock200Response, @@ -30,14 +29,13 @@ import type { GetRawShardInfo200Response, GetRawTime200Response, GetRawTransactions200Response, + ReduceIndexingLatencyDefaultResponse, SendRawMessage200Response, SendRawMessageRequest, } from '../models/index'; import { GetAllRawShardsInfo200ResponseFromJSON, GetAllRawShardsInfo200ResponseToJSON, - GetBlockchainBlockDefaultResponseFromJSON, - GetBlockchainBlockDefaultResponseToJSON, GetRawAccountState200ResponseFromJSON, GetRawAccountState200ResponseToJSON, GetRawBlockProof200ResponseFromJSON, @@ -64,6 +62,8 @@ import { GetRawTime200ResponseToJSON, GetRawTransactions200ResponseFromJSON, GetRawTransactions200ResponseToJSON, + ReduceIndexingLatencyDefaultResponseFromJSON, + ReduceIndexingLatencyDefaultResponseToJSON, SendRawMessage200ResponseFromJSON, SendRawMessage200ResponseToJSON, SendRawMessageRequestFromJSON, @@ -378,8 +378,11 @@ export class LiteServerApi extends runtime.BaseAPI implements LiteServerApiInter * Get all raw shards info */ async getAllRawShardsInfoRaw(requestParameters: GetAllRawShardsInfoRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.blockId === null || requestParameters.blockId === undefined) { - throw new runtime.RequiredError('blockId','Required parameter requestParameters.blockId was null or undefined when calling getAllRawShardsInfo.'); + if (requestParameters['blockId'] == null) { + throw new runtime.RequiredError( + 'blockId', + 'Required parameter "blockId" was null or undefined when calling getAllRawShardsInfo().' + ); } const queryParameters: any = {}; @@ -387,7 +390,7 @@ export class LiteServerApi extends runtime.BaseAPI implements LiteServerApiInter const headerParameters: runtime.HTTPHeaders = {}; const response = await this.request({ - path: `/v2/liteserver/get_all_shards_info/{block_id}`.replace(`{${"block_id"}}`, encodeURIComponent(String(requestParameters.blockId))), + path: `/v2/liteserver/get_all_shards_info/{block_id}`.replace(`{${"block_id"}}`, encodeURIComponent(String(requestParameters['blockId']))), method: 'GET', headers: headerParameters, query: queryParameters, @@ -408,20 +411,23 @@ export class LiteServerApi extends runtime.BaseAPI implements LiteServerApiInter * Get raw account state */ async getRawAccountStateRaw(requestParameters: GetRawAccountStateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.accountId === null || requestParameters.accountId === undefined) { - throw new runtime.RequiredError('accountId','Required parameter requestParameters.accountId was null or undefined when calling getRawAccountState.'); + if (requestParameters['accountId'] == null) { + throw new runtime.RequiredError( + 'accountId', + 'Required parameter "accountId" was null or undefined when calling getRawAccountState().' + ); } const queryParameters: any = {}; - if (requestParameters.targetBlock !== undefined) { - queryParameters['target_block'] = requestParameters.targetBlock; + if (requestParameters['targetBlock'] != null) { + queryParameters['target_block'] = requestParameters['targetBlock']; } const headerParameters: runtime.HTTPHeaders = {}; const response = await this.request({ - path: `/v2/liteserver/get_account_state/{account_id}`.replace(`{${"account_id"}}`, encodeURIComponent(String(requestParameters.accountId))), + path: `/v2/liteserver/get_account_state/{account_id}`.replace(`{${"account_id"}}`, encodeURIComponent(String(requestParameters['accountId']))), method: 'GET', headers: headerParameters, query: queryParameters, @@ -442,26 +448,32 @@ export class LiteServerApi extends runtime.BaseAPI implements LiteServerApiInter * Get raw block proof */ async getRawBlockProofRaw(requestParameters: GetRawBlockProofRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.knownBlock === null || requestParameters.knownBlock === undefined) { - throw new runtime.RequiredError('knownBlock','Required parameter requestParameters.knownBlock was null or undefined when calling getRawBlockProof.'); + if (requestParameters['knownBlock'] == null) { + throw new runtime.RequiredError( + 'knownBlock', + 'Required parameter "knownBlock" was null or undefined when calling getRawBlockProof().' + ); } - if (requestParameters.mode === null || requestParameters.mode === undefined) { - throw new runtime.RequiredError('mode','Required parameter requestParameters.mode was null or undefined when calling getRawBlockProof.'); + if (requestParameters['mode'] == null) { + throw new runtime.RequiredError( + 'mode', + 'Required parameter "mode" was null or undefined when calling getRawBlockProof().' + ); } const queryParameters: any = {}; - if (requestParameters.knownBlock !== undefined) { - queryParameters['known_block'] = requestParameters.knownBlock; + if (requestParameters['knownBlock'] != null) { + queryParameters['known_block'] = requestParameters['knownBlock']; } - if (requestParameters.targetBlock !== undefined) { - queryParameters['target_block'] = requestParameters.targetBlock; + if (requestParameters['targetBlock'] != null) { + queryParameters['target_block'] = requestParameters['targetBlock']; } - if (requestParameters.mode !== undefined) { - queryParameters['mode'] = requestParameters.mode; + if (requestParameters['mode'] != null) { + queryParameters['mode'] = requestParameters['mode']; } const headerParameters: runtime.HTTPHeaders = {}; @@ -488,8 +500,11 @@ export class LiteServerApi extends runtime.BaseAPI implements LiteServerApiInter * Get raw blockchain block */ async getRawBlockchainBlockRaw(requestParameters: GetRawBlockchainBlockRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.blockId === null || requestParameters.blockId === undefined) { - throw new runtime.RequiredError('blockId','Required parameter requestParameters.blockId was null or undefined when calling getRawBlockchainBlock.'); + if (requestParameters['blockId'] == null) { + throw new runtime.RequiredError( + 'blockId', + 'Required parameter "blockId" was null or undefined when calling getRawBlockchainBlock().' + ); } const queryParameters: any = {}; @@ -497,7 +512,7 @@ export class LiteServerApi extends runtime.BaseAPI implements LiteServerApiInter const headerParameters: runtime.HTTPHeaders = {}; const response = await this.request({ - path: `/v2/liteserver/get_block/{block_id}`.replace(`{${"block_id"}}`, encodeURIComponent(String(requestParameters.blockId))), + path: `/v2/liteserver/get_block/{block_id}`.replace(`{${"block_id"}}`, encodeURIComponent(String(requestParameters['blockId']))), method: 'GET', headers: headerParameters, query: queryParameters, @@ -518,24 +533,30 @@ export class LiteServerApi extends runtime.BaseAPI implements LiteServerApiInter * Get raw blockchain block header */ async getRawBlockchainBlockHeaderRaw(requestParameters: GetRawBlockchainBlockHeaderRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.blockId === null || requestParameters.blockId === undefined) { - throw new runtime.RequiredError('blockId','Required parameter requestParameters.blockId was null or undefined when calling getRawBlockchainBlockHeader.'); + if (requestParameters['blockId'] == null) { + throw new runtime.RequiredError( + 'blockId', + 'Required parameter "blockId" was null or undefined when calling getRawBlockchainBlockHeader().' + ); } - if (requestParameters.mode === null || requestParameters.mode === undefined) { - throw new runtime.RequiredError('mode','Required parameter requestParameters.mode was null or undefined when calling getRawBlockchainBlockHeader.'); + if (requestParameters['mode'] == null) { + throw new runtime.RequiredError( + 'mode', + 'Required parameter "mode" was null or undefined when calling getRawBlockchainBlockHeader().' + ); } const queryParameters: any = {}; - if (requestParameters.mode !== undefined) { - queryParameters['mode'] = requestParameters.mode; + if (requestParameters['mode'] != null) { + queryParameters['mode'] = requestParameters['mode']; } const headerParameters: runtime.HTTPHeaders = {}; const response = await this.request({ - path: `/v2/liteserver/get_block_header/{block_id}`.replace(`{${"block_id"}}`, encodeURIComponent(String(requestParameters.blockId))), + path: `/v2/liteserver/get_block_header/{block_id}`.replace(`{${"block_id"}}`, encodeURIComponent(String(requestParameters['blockId']))), method: 'GET', headers: headerParameters, query: queryParameters, @@ -556,8 +577,11 @@ export class LiteServerApi extends runtime.BaseAPI implements LiteServerApiInter * Get raw blockchain block state */ async getRawBlockchainBlockStateRaw(requestParameters: GetRawBlockchainBlockStateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.blockId === null || requestParameters.blockId === undefined) { - throw new runtime.RequiredError('blockId','Required parameter requestParameters.blockId was null or undefined when calling getRawBlockchainBlockState.'); + if (requestParameters['blockId'] == null) { + throw new runtime.RequiredError( + 'blockId', + 'Required parameter "blockId" was null or undefined when calling getRawBlockchainBlockState().' + ); } const queryParameters: any = {}; @@ -565,7 +589,7 @@ export class LiteServerApi extends runtime.BaseAPI implements LiteServerApiInter const headerParameters: runtime.HTTPHeaders = {}; const response = await this.request({ - path: `/v2/liteserver/get_state/{block_id}`.replace(`{${"block_id"}}`, encodeURIComponent(String(requestParameters.blockId))), + path: `/v2/liteserver/get_state/{block_id}`.replace(`{${"block_id"}}`, encodeURIComponent(String(requestParameters['blockId']))), method: 'GET', headers: headerParameters, query: queryParameters, @@ -586,24 +610,30 @@ export class LiteServerApi extends runtime.BaseAPI implements LiteServerApiInter * Get raw config */ async getRawConfigRaw(requestParameters: GetRawConfigRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.blockId === null || requestParameters.blockId === undefined) { - throw new runtime.RequiredError('blockId','Required parameter requestParameters.blockId was null or undefined when calling getRawConfig.'); + if (requestParameters['blockId'] == null) { + throw new runtime.RequiredError( + 'blockId', + 'Required parameter "blockId" was null or undefined when calling getRawConfig().' + ); } - if (requestParameters.mode === null || requestParameters.mode === undefined) { - throw new runtime.RequiredError('mode','Required parameter requestParameters.mode was null or undefined when calling getRawConfig.'); + if (requestParameters['mode'] == null) { + throw new runtime.RequiredError( + 'mode', + 'Required parameter "mode" was null or undefined when calling getRawConfig().' + ); } const queryParameters: any = {}; - if (requestParameters.mode !== undefined) { - queryParameters['mode'] = requestParameters.mode; + if (requestParameters['mode'] != null) { + queryParameters['mode'] = requestParameters['mode']; } const headerParameters: runtime.HTTPHeaders = {}; const response = await this.request({ - path: `/v2/liteserver/get_config_all/{block_id}`.replace(`{${"block_id"}}`, encodeURIComponent(String(requestParameters.blockId))), + path: `/v2/liteserver/get_config_all/{block_id}`.replace(`{${"block_id"}}`, encodeURIComponent(String(requestParameters['blockId']))), method: 'GET', headers: headerParameters, query: queryParameters, @@ -624,40 +654,49 @@ export class LiteServerApi extends runtime.BaseAPI implements LiteServerApiInter * Get raw list block transactions */ async getRawListBlockTransactionsRaw(requestParameters: GetRawListBlockTransactionsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.blockId === null || requestParameters.blockId === undefined) { - throw new runtime.RequiredError('blockId','Required parameter requestParameters.blockId was null or undefined when calling getRawListBlockTransactions.'); + if (requestParameters['blockId'] == null) { + throw new runtime.RequiredError( + 'blockId', + 'Required parameter "blockId" was null or undefined when calling getRawListBlockTransactions().' + ); } - if (requestParameters.mode === null || requestParameters.mode === undefined) { - throw new runtime.RequiredError('mode','Required parameter requestParameters.mode was null or undefined when calling getRawListBlockTransactions.'); + if (requestParameters['mode'] == null) { + throw new runtime.RequiredError( + 'mode', + 'Required parameter "mode" was null or undefined when calling getRawListBlockTransactions().' + ); } - if (requestParameters.count === null || requestParameters.count === undefined) { - throw new runtime.RequiredError('count','Required parameter requestParameters.count was null or undefined when calling getRawListBlockTransactions.'); + if (requestParameters['count'] == null) { + throw new runtime.RequiredError( + 'count', + 'Required parameter "count" was null or undefined when calling getRawListBlockTransactions().' + ); } const queryParameters: any = {}; - if (requestParameters.mode !== undefined) { - queryParameters['mode'] = requestParameters.mode; + if (requestParameters['mode'] != null) { + queryParameters['mode'] = requestParameters['mode']; } - if (requestParameters.count !== undefined) { - queryParameters['count'] = requestParameters.count; + if (requestParameters['count'] != null) { + queryParameters['count'] = requestParameters['count']; } - if (requestParameters.accountId !== undefined) { - queryParameters['account_id'] = requestParameters.accountId; + if (requestParameters['accountId'] != null) { + queryParameters['account_id'] = requestParameters['accountId']; } - if (requestParameters.lt !== undefined) { - queryParameters['lt'] = requestParameters.lt; + if (requestParameters['lt'] != null) { + queryParameters['lt'] = requestParameters['lt']; } const headerParameters: runtime.HTTPHeaders = {}; const response = await this.request({ - path: `/v2/liteserver/list_block_transactions/{block_id}`.replace(`{${"block_id"}}`, encodeURIComponent(String(requestParameters.blockId))), + path: `/v2/liteserver/list_block_transactions/{block_id}`.replace(`{${"block_id"}}`, encodeURIComponent(String(requestParameters['blockId']))), method: 'GET', headers: headerParameters, query: queryParameters, @@ -704,14 +743,17 @@ export class LiteServerApi extends runtime.BaseAPI implements LiteServerApiInter * Get raw masterchain info ext */ async getRawMasterchainInfoExtRaw(requestParameters: GetRawMasterchainInfoExtRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.mode === null || requestParameters.mode === undefined) { - throw new runtime.RequiredError('mode','Required parameter requestParameters.mode was null or undefined when calling getRawMasterchainInfoExt.'); + if (requestParameters['mode'] == null) { + throw new runtime.RequiredError( + 'mode', + 'Required parameter "mode" was null or undefined when calling getRawMasterchainInfoExt().' + ); } const queryParameters: any = {}; - if (requestParameters.mode !== undefined) { - queryParameters['mode'] = requestParameters.mode; + if (requestParameters['mode'] != null) { + queryParameters['mode'] = requestParameters['mode']; } const headerParameters: runtime.HTTPHeaders = {}; @@ -738,8 +780,11 @@ export class LiteServerApi extends runtime.BaseAPI implements LiteServerApiInter * Get raw shard block proof */ async getRawShardBlockProofRaw(requestParameters: GetRawShardBlockProofRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.blockId === null || requestParameters.blockId === undefined) { - throw new runtime.RequiredError('blockId','Required parameter requestParameters.blockId was null or undefined when calling getRawShardBlockProof.'); + if (requestParameters['blockId'] == null) { + throw new runtime.RequiredError( + 'blockId', + 'Required parameter "blockId" was null or undefined when calling getRawShardBlockProof().' + ); } const queryParameters: any = {}; @@ -747,7 +792,7 @@ export class LiteServerApi extends runtime.BaseAPI implements LiteServerApiInter const headerParameters: runtime.HTTPHeaders = {}; const response = await this.request({ - path: `/v2/liteserver/get_shard_block_proof/{block_id}`.replace(`{${"block_id"}}`, encodeURIComponent(String(requestParameters.blockId))), + path: `/v2/liteserver/get_shard_block_proof/{block_id}`.replace(`{${"block_id"}}`, encodeURIComponent(String(requestParameters['blockId']))), method: 'GET', headers: headerParameters, query: queryParameters, @@ -768,40 +813,52 @@ export class LiteServerApi extends runtime.BaseAPI implements LiteServerApiInter * Get raw shard info */ async getRawShardInfoRaw(requestParameters: GetRawShardInfoRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.blockId === null || requestParameters.blockId === undefined) { - throw new runtime.RequiredError('blockId','Required parameter requestParameters.blockId was null or undefined when calling getRawShardInfo.'); + if (requestParameters['blockId'] == null) { + throw new runtime.RequiredError( + 'blockId', + 'Required parameter "blockId" was null or undefined when calling getRawShardInfo().' + ); } - if (requestParameters.workchain === null || requestParameters.workchain === undefined) { - throw new runtime.RequiredError('workchain','Required parameter requestParameters.workchain was null or undefined when calling getRawShardInfo.'); + if (requestParameters['workchain'] == null) { + throw new runtime.RequiredError( + 'workchain', + 'Required parameter "workchain" was null or undefined when calling getRawShardInfo().' + ); } - if (requestParameters.shard === null || requestParameters.shard === undefined) { - throw new runtime.RequiredError('shard','Required parameter requestParameters.shard was null or undefined when calling getRawShardInfo.'); + if (requestParameters['shard'] == null) { + throw new runtime.RequiredError( + 'shard', + 'Required parameter "shard" was null or undefined when calling getRawShardInfo().' + ); } - if (requestParameters.exact === null || requestParameters.exact === undefined) { - throw new runtime.RequiredError('exact','Required parameter requestParameters.exact was null or undefined when calling getRawShardInfo.'); + if (requestParameters['exact'] == null) { + throw new runtime.RequiredError( + 'exact', + 'Required parameter "exact" was null or undefined when calling getRawShardInfo().' + ); } const queryParameters: any = {}; - if (requestParameters.workchain !== undefined) { - queryParameters['workchain'] = requestParameters.workchain; + if (requestParameters['workchain'] != null) { + queryParameters['workchain'] = requestParameters['workchain']; } - if (requestParameters.shard !== undefined) { - queryParameters['shard'] = requestParameters.shard; + if (requestParameters['shard'] != null) { + queryParameters['shard'] = requestParameters['shard']; } - if (requestParameters.exact !== undefined) { - queryParameters['exact'] = requestParameters.exact; + if (requestParameters['exact'] != null) { + queryParameters['exact'] = requestParameters['exact']; } const headerParameters: runtime.HTTPHeaders = {}; const response = await this.request({ - path: `/v2/liteserver/get_shard_info/{block_id}`.replace(`{${"block_id"}}`, encodeURIComponent(String(requestParameters.blockId))), + path: `/v2/liteserver/get_shard_info/{block_id}`.replace(`{${"block_id"}}`, encodeURIComponent(String(requestParameters['blockId']))), method: 'GET', headers: headerParameters, query: queryParameters, @@ -848,40 +905,52 @@ export class LiteServerApi extends runtime.BaseAPI implements LiteServerApiInter * Get raw transactions */ async getRawTransactionsRaw(requestParameters: GetRawTransactionsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.accountId === null || requestParameters.accountId === undefined) { - throw new runtime.RequiredError('accountId','Required parameter requestParameters.accountId was null or undefined when calling getRawTransactions.'); + if (requestParameters['accountId'] == null) { + throw new runtime.RequiredError( + 'accountId', + 'Required parameter "accountId" was null or undefined when calling getRawTransactions().' + ); } - if (requestParameters.count === null || requestParameters.count === undefined) { - throw new runtime.RequiredError('count','Required parameter requestParameters.count was null or undefined when calling getRawTransactions.'); + if (requestParameters['count'] == null) { + throw new runtime.RequiredError( + 'count', + 'Required parameter "count" was null or undefined when calling getRawTransactions().' + ); } - if (requestParameters.lt === null || requestParameters.lt === undefined) { - throw new runtime.RequiredError('lt','Required parameter requestParameters.lt was null or undefined when calling getRawTransactions.'); + if (requestParameters['lt'] == null) { + throw new runtime.RequiredError( + 'lt', + 'Required parameter "lt" was null or undefined when calling getRawTransactions().' + ); } - if (requestParameters.hash === null || requestParameters.hash === undefined) { - throw new runtime.RequiredError('hash','Required parameter requestParameters.hash was null or undefined when calling getRawTransactions.'); + if (requestParameters['hash'] == null) { + throw new runtime.RequiredError( + 'hash', + 'Required parameter "hash" was null or undefined when calling getRawTransactions().' + ); } const queryParameters: any = {}; - if (requestParameters.count !== undefined) { - queryParameters['count'] = requestParameters.count; + if (requestParameters['count'] != null) { + queryParameters['count'] = requestParameters['count']; } - if (requestParameters.lt !== undefined) { - queryParameters['lt'] = requestParameters.lt; + if (requestParameters['lt'] != null) { + queryParameters['lt'] = requestParameters['lt']; } - if (requestParameters.hash !== undefined) { - queryParameters['hash'] = requestParameters.hash; + if (requestParameters['hash'] != null) { + queryParameters['hash'] = requestParameters['hash']; } const headerParameters: runtime.HTTPHeaders = {}; const response = await this.request({ - path: `/v2/liteserver/get_transactions/{account_id}`.replace(`{${"account_id"}}`, encodeURIComponent(String(requestParameters.accountId))), + path: `/v2/liteserver/get_transactions/{account_id}`.replace(`{${"account_id"}}`, encodeURIComponent(String(requestParameters['accountId']))), method: 'GET', headers: headerParameters, query: queryParameters, @@ -902,8 +971,11 @@ export class LiteServerApi extends runtime.BaseAPI implements LiteServerApiInter * Send raw message to blockchain */ async sendRawMessageRaw(requestParameters: SendRawMessageOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.sendRawMessageRequest === null || requestParameters.sendRawMessageRequest === undefined) { - throw new runtime.RequiredError('sendRawMessageRequest','Required parameter requestParameters.sendRawMessageRequest was null or undefined when calling sendRawMessage.'); + if (requestParameters['sendRawMessageRequest'] == null) { + throw new runtime.RequiredError( + 'sendRawMessageRequest', + 'Required parameter "sendRawMessageRequest" was null or undefined when calling sendRawMessage().' + ); } const queryParameters: any = {}; @@ -917,7 +989,7 @@ export class LiteServerApi extends runtime.BaseAPI implements LiteServerApiInter method: 'POST', headers: headerParameters, query: queryParameters, - body: SendRawMessageRequestToJSON(requestParameters.sendRawMessageRequest), + body: SendRawMessageRequestToJSON(requestParameters['sendRawMessageRequest']), }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => SendRawMessage200ResponseFromJSON(jsonValue)); diff --git a/packages/core/src/tonApiV2/apis/NFTApi.ts b/packages/core/src/tonApiV2/apis/NFTApi.ts index 8b8aaa364..ddc5f2ab8 100644 --- a/packages/core/src/tonApiV2/apis/NFTApi.ts +++ b/packages/core/src/tonApiV2/apis/NFTApi.ts @@ -17,19 +17,17 @@ import * as runtime from '../runtime'; import type { AccountEvents, GetAccountsRequest, - GetBlockchainBlockDefaultResponse, NftCollection, NftCollections, NftItem, NftItems, + ReduceIndexingLatencyDefaultResponse, } from '../models/index'; import { AccountEventsFromJSON, AccountEventsToJSON, GetAccountsRequestFromJSON, GetAccountsRequestToJSON, - GetBlockchainBlockDefaultResponseFromJSON, - GetBlockchainBlockDefaultResponseToJSON, NftCollectionFromJSON, NftCollectionToJSON, NftCollectionsFromJSON, @@ -38,6 +36,8 @@ import { NftItemToJSON, NftItemsFromJSON, NftItemsToJSON, + ReduceIndexingLatencyDefaultResponseFromJSON, + ReduceIndexingLatencyDefaultResponseToJSON, } from '../models/index'; export interface GetAccountNftHistoryRequest { @@ -210,40 +210,46 @@ export class NFTApi extends runtime.BaseAPI implements NFTApiInterface { * Get the transfer nft history */ async getAccountNftHistoryRaw(requestParameters: GetAccountNftHistoryRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.accountId === null || requestParameters.accountId === undefined) { - throw new runtime.RequiredError('accountId','Required parameter requestParameters.accountId was null or undefined when calling getAccountNftHistory.'); + if (requestParameters['accountId'] == null) { + throw new runtime.RequiredError( + 'accountId', + 'Required parameter "accountId" was null or undefined when calling getAccountNftHistory().' + ); } - if (requestParameters.limit === null || requestParameters.limit === undefined) { - throw new runtime.RequiredError('limit','Required parameter requestParameters.limit was null or undefined when calling getAccountNftHistory.'); + if (requestParameters['limit'] == null) { + throw new runtime.RequiredError( + 'limit', + 'Required parameter "limit" was null or undefined when calling getAccountNftHistory().' + ); } const queryParameters: any = {}; - if (requestParameters.beforeLt !== undefined) { - queryParameters['before_lt'] = requestParameters.beforeLt; + if (requestParameters['beforeLt'] != null) { + queryParameters['before_lt'] = requestParameters['beforeLt']; } - if (requestParameters.limit !== undefined) { - queryParameters['limit'] = requestParameters.limit; + if (requestParameters['limit'] != null) { + queryParameters['limit'] = requestParameters['limit']; } - if (requestParameters.startDate !== undefined) { - queryParameters['start_date'] = requestParameters.startDate; + if (requestParameters['startDate'] != null) { + queryParameters['start_date'] = requestParameters['startDate']; } - if (requestParameters.endDate !== undefined) { - queryParameters['end_date'] = requestParameters.endDate; + if (requestParameters['endDate'] != null) { + queryParameters['end_date'] = requestParameters['endDate']; } const headerParameters: runtime.HTTPHeaders = {}; - if (requestParameters.acceptLanguage !== undefined && requestParameters.acceptLanguage !== null) { - headerParameters['Accept-Language'] = String(requestParameters.acceptLanguage); + if (requestParameters['acceptLanguage'] != null) { + headerParameters['Accept-Language'] = String(requestParameters['acceptLanguage']); } const response = await this.request({ - path: `/v2/accounts/{account_id}/nfts/history`.replace(`{${"account_id"}}`, encodeURIComponent(String(requestParameters.accountId))), + path: `/v2/accounts/{account_id}/nfts/history`.replace(`{${"account_id"}}`, encodeURIComponent(String(requestParameters['accountId']))), method: 'GET', headers: headerParameters, query: queryParameters, @@ -264,24 +270,27 @@ export class NFTApi extends runtime.BaseAPI implements NFTApiInterface { * Get NFT items from collection by collection address */ async getItemsFromCollectionRaw(requestParameters: GetItemsFromCollectionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.accountId === null || requestParameters.accountId === undefined) { - throw new runtime.RequiredError('accountId','Required parameter requestParameters.accountId was null or undefined when calling getItemsFromCollection.'); + if (requestParameters['accountId'] == null) { + throw new runtime.RequiredError( + 'accountId', + 'Required parameter "accountId" was null or undefined when calling getItemsFromCollection().' + ); } const queryParameters: any = {}; - if (requestParameters.limit !== undefined) { - queryParameters['limit'] = requestParameters.limit; + if (requestParameters['limit'] != null) { + queryParameters['limit'] = requestParameters['limit']; } - if (requestParameters.offset !== undefined) { - queryParameters['offset'] = requestParameters.offset; + if (requestParameters['offset'] != null) { + queryParameters['offset'] = requestParameters['offset']; } const headerParameters: runtime.HTTPHeaders = {}; const response = await this.request({ - path: `/v2/nfts/collections/{account_id}/items`.replace(`{${"account_id"}}`, encodeURIComponent(String(requestParameters.accountId))), + path: `/v2/nfts/collections/{account_id}/items`.replace(`{${"account_id"}}`, encodeURIComponent(String(requestParameters['accountId']))), method: 'GET', headers: headerParameters, query: queryParameters, @@ -302,8 +311,11 @@ export class NFTApi extends runtime.BaseAPI implements NFTApiInterface { * Get NFT collection by collection address */ async getNftCollectionRaw(requestParameters: GetNftCollectionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.accountId === null || requestParameters.accountId === undefined) { - throw new runtime.RequiredError('accountId','Required parameter requestParameters.accountId was null or undefined when calling getNftCollection.'); + if (requestParameters['accountId'] == null) { + throw new runtime.RequiredError( + 'accountId', + 'Required parameter "accountId" was null or undefined when calling getNftCollection().' + ); } const queryParameters: any = {}; @@ -311,7 +323,7 @@ export class NFTApi extends runtime.BaseAPI implements NFTApiInterface { const headerParameters: runtime.HTTPHeaders = {}; const response = await this.request({ - path: `/v2/nfts/collections/{account_id}`.replace(`{${"account_id"}}`, encodeURIComponent(String(requestParameters.accountId))), + path: `/v2/nfts/collections/{account_id}`.replace(`{${"account_id"}}`, encodeURIComponent(String(requestParameters['accountId']))), method: 'GET', headers: headerParameters, query: queryParameters, @@ -334,12 +346,12 @@ export class NFTApi extends runtime.BaseAPI implements NFTApiInterface { async getNftCollectionsRaw(requestParameters: GetNftCollectionsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { const queryParameters: any = {}; - if (requestParameters.limit !== undefined) { - queryParameters['limit'] = requestParameters.limit; + if (requestParameters['limit'] != null) { + queryParameters['limit'] = requestParameters['limit']; } - if (requestParameters.offset !== undefined) { - queryParameters['offset'] = requestParameters.offset; + if (requestParameters['offset'] != null) { + queryParameters['offset'] = requestParameters['offset']; } const headerParameters: runtime.HTTPHeaders = {}; @@ -366,40 +378,46 @@ export class NFTApi extends runtime.BaseAPI implements NFTApiInterface { * Get the transfer nfts history for account */ async getNftHistoryByIDRaw(requestParameters: GetNftHistoryByIDRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.accountId === null || requestParameters.accountId === undefined) { - throw new runtime.RequiredError('accountId','Required parameter requestParameters.accountId was null or undefined when calling getNftHistoryByID.'); + if (requestParameters['accountId'] == null) { + throw new runtime.RequiredError( + 'accountId', + 'Required parameter "accountId" was null or undefined when calling getNftHistoryByID().' + ); } - if (requestParameters.limit === null || requestParameters.limit === undefined) { - throw new runtime.RequiredError('limit','Required parameter requestParameters.limit was null or undefined when calling getNftHistoryByID.'); + if (requestParameters['limit'] == null) { + throw new runtime.RequiredError( + 'limit', + 'Required parameter "limit" was null or undefined when calling getNftHistoryByID().' + ); } const queryParameters: any = {}; - if (requestParameters.beforeLt !== undefined) { - queryParameters['before_lt'] = requestParameters.beforeLt; + if (requestParameters['beforeLt'] != null) { + queryParameters['before_lt'] = requestParameters['beforeLt']; } - if (requestParameters.limit !== undefined) { - queryParameters['limit'] = requestParameters.limit; + if (requestParameters['limit'] != null) { + queryParameters['limit'] = requestParameters['limit']; } - if (requestParameters.startDate !== undefined) { - queryParameters['start_date'] = requestParameters.startDate; + if (requestParameters['startDate'] != null) { + queryParameters['start_date'] = requestParameters['startDate']; } - if (requestParameters.endDate !== undefined) { - queryParameters['end_date'] = requestParameters.endDate; + if (requestParameters['endDate'] != null) { + queryParameters['end_date'] = requestParameters['endDate']; } const headerParameters: runtime.HTTPHeaders = {}; - if (requestParameters.acceptLanguage !== undefined && requestParameters.acceptLanguage !== null) { - headerParameters['Accept-Language'] = String(requestParameters.acceptLanguage); + if (requestParameters['acceptLanguage'] != null) { + headerParameters['Accept-Language'] = String(requestParameters['acceptLanguage']); } const response = await this.request({ - path: `/v2/nfts/{account_id}/history`.replace(`{${"account_id"}}`, encodeURIComponent(String(requestParameters.accountId))), + path: `/v2/nfts/{account_id}/history`.replace(`{${"account_id"}}`, encodeURIComponent(String(requestParameters['accountId']))), method: 'GET', headers: headerParameters, query: queryParameters, @@ -420,8 +438,11 @@ export class NFTApi extends runtime.BaseAPI implements NFTApiInterface { * Get NFT item by its address */ async getNftItemByAddressRaw(requestParameters: GetNftItemByAddressRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.accountId === null || requestParameters.accountId === undefined) { - throw new runtime.RequiredError('accountId','Required parameter requestParameters.accountId was null or undefined when calling getNftItemByAddress.'); + if (requestParameters['accountId'] == null) { + throw new runtime.RequiredError( + 'accountId', + 'Required parameter "accountId" was null or undefined when calling getNftItemByAddress().' + ); } const queryParameters: any = {}; @@ -429,7 +450,7 @@ export class NFTApi extends runtime.BaseAPI implements NFTApiInterface { const headerParameters: runtime.HTTPHeaders = {}; const response = await this.request({ - path: `/v2/nfts/{account_id}`.replace(`{${"account_id"}}`, encodeURIComponent(String(requestParameters.accountId))), + path: `/v2/nfts/{account_id}`.replace(`{${"account_id"}}`, encodeURIComponent(String(requestParameters['accountId']))), method: 'GET', headers: headerParameters, query: queryParameters, @@ -461,7 +482,7 @@ export class NFTApi extends runtime.BaseAPI implements NFTApiInterface { method: 'POST', headers: headerParameters, query: queryParameters, - body: GetAccountsRequestToJSON(requestParameters.getAccountsRequest), + body: GetAccountsRequestToJSON(requestParameters['getAccountsRequest']), }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => NftItemsFromJSON(jsonValue)); diff --git a/packages/core/src/tonApiV2/apis/RatesApi.ts b/packages/core/src/tonApiV2/apis/RatesApi.ts index 9697b392e..2a2352ab1 100644 --- a/packages/core/src/tonApiV2/apis/RatesApi.ts +++ b/packages/core/src/tonApiV2/apis/RatesApi.ts @@ -15,17 +15,17 @@ import * as runtime from '../runtime'; import type { - GetBlockchainBlockDefaultResponse, GetChartRates200Response, GetRates200Response, + ReduceIndexingLatencyDefaultResponse, } from '../models/index'; import { - GetBlockchainBlockDefaultResponseFromJSON, - GetBlockchainBlockDefaultResponseToJSON, GetChartRates200ResponseFromJSON, GetChartRates200ResponseToJSON, GetRates200ResponseFromJSON, GetRates200ResponseToJSON, + ReduceIndexingLatencyDefaultResponseFromJSON, + ReduceIndexingLatencyDefaultResponseToJSON, } from '../models/index'; export interface GetChartRatesRequest { @@ -33,11 +33,12 @@ export interface GetChartRatesRequest { currency?: string; startDate?: number; endDate?: number; + pointsCount?: number; } export interface GetRatesRequest { - tokens: string; - currencies: string; + tokens: Array; + currencies: Array; } /** @@ -53,6 +54,7 @@ export interface RatesApiInterface { * @param {string} [currency] * @param {number} [startDate] * @param {number} [endDate] + * @param {number} [pointsCount] * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof RatesApiInterface @@ -66,8 +68,8 @@ export interface RatesApiInterface { /** * Get the token price to the currency - * @param {string} tokens accept ton and jetton master addresses, separated by commas - * @param {string} currencies accept ton and all possible fiat currencies, separated by commas + * @param {Array} tokens accept ton and jetton master addresses, separated by commas + * @param {Array} currencies accept ton and all possible fiat currencies, separated by commas * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof RatesApiInterface @@ -90,26 +92,33 @@ export class RatesApi extends runtime.BaseAPI implements RatesApiInterface { * Get chart by token */ async getChartRatesRaw(requestParameters: GetChartRatesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.token === null || requestParameters.token === undefined) { - throw new runtime.RequiredError('token','Required parameter requestParameters.token was null or undefined when calling getChartRates.'); + if (requestParameters['token'] == null) { + throw new runtime.RequiredError( + 'token', + 'Required parameter "token" was null or undefined when calling getChartRates().' + ); } const queryParameters: any = {}; - if (requestParameters.token !== undefined) { - queryParameters['token'] = requestParameters.token; + if (requestParameters['token'] != null) { + queryParameters['token'] = requestParameters['token']; } - if (requestParameters.currency !== undefined) { - queryParameters['currency'] = requestParameters.currency; + if (requestParameters['currency'] != null) { + queryParameters['currency'] = requestParameters['currency']; } - if (requestParameters.startDate !== undefined) { - queryParameters['start_date'] = requestParameters.startDate; + if (requestParameters['startDate'] != null) { + queryParameters['start_date'] = requestParameters['startDate']; } - if (requestParameters.endDate !== undefined) { - queryParameters['end_date'] = requestParameters.endDate; + if (requestParameters['endDate'] != null) { + queryParameters['end_date'] = requestParameters['endDate']; + } + + if (requestParameters['pointsCount'] != null) { + queryParameters['points_count'] = requestParameters['pointsCount']; } const headerParameters: runtime.HTTPHeaders = {}; @@ -136,22 +145,28 @@ export class RatesApi extends runtime.BaseAPI implements RatesApiInterface { * Get the token price to the currency */ async getRatesRaw(requestParameters: GetRatesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.tokens === null || requestParameters.tokens === undefined) { - throw new runtime.RequiredError('tokens','Required parameter requestParameters.tokens was null or undefined when calling getRates.'); + if (requestParameters['tokens'] == null) { + throw new runtime.RequiredError( + 'tokens', + 'Required parameter "tokens" was null or undefined when calling getRates().' + ); } - if (requestParameters.currencies === null || requestParameters.currencies === undefined) { - throw new runtime.RequiredError('currencies','Required parameter requestParameters.currencies was null or undefined when calling getRates.'); + if (requestParameters['currencies'] == null) { + throw new runtime.RequiredError( + 'currencies', + 'Required parameter "currencies" was null or undefined when calling getRates().' + ); } const queryParameters: any = {}; - if (requestParameters.tokens !== undefined) { - queryParameters['tokens'] = requestParameters.tokens; + if (requestParameters['tokens'] != null) { + queryParameters['tokens'] = requestParameters['tokens']!.join(runtime.COLLECTION_FORMATS["csv"]); } - if (requestParameters.currencies !== undefined) { - queryParameters['currencies'] = requestParameters.currencies; + if (requestParameters['currencies'] != null) { + queryParameters['currencies'] = requestParameters['currencies']!.join(runtime.COLLECTION_FORMATS["csv"]); } const headerParameters: runtime.HTTPHeaders = {}; diff --git a/packages/core/src/tonApiV2/apis/StakingApi.ts b/packages/core/src/tonApiV2/apis/StakingApi.ts index 29103b654..524344fb9 100644 --- a/packages/core/src/tonApiV2/apis/StakingApi.ts +++ b/packages/core/src/tonApiV2/apis/StakingApi.ts @@ -16,22 +16,22 @@ import * as runtime from '../runtime'; import type { AccountStaking, - GetBlockchainBlockDefaultResponse, GetStakingPoolHistory200Response, GetStakingPoolInfo200Response, GetStakingPools200Response, + ReduceIndexingLatencyDefaultResponse, } from '../models/index'; import { AccountStakingFromJSON, AccountStakingToJSON, - GetBlockchainBlockDefaultResponseFromJSON, - GetBlockchainBlockDefaultResponseToJSON, GetStakingPoolHistory200ResponseFromJSON, GetStakingPoolHistory200ResponseToJSON, GetStakingPoolInfo200ResponseFromJSON, GetStakingPoolInfo200ResponseToJSON, GetStakingPools200ResponseFromJSON, GetStakingPools200ResponseToJSON, + ReduceIndexingLatencyDefaultResponseFromJSON, + ReduceIndexingLatencyDefaultResponseToJSON, } from '../models/index'; export interface GetAccountNominatorsPoolsRequest { @@ -130,8 +130,11 @@ export class StakingApi extends runtime.BaseAPI implements StakingApiInterface { * All pools where account participates */ async getAccountNominatorsPoolsRaw(requestParameters: GetAccountNominatorsPoolsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.accountId === null || requestParameters.accountId === undefined) { - throw new runtime.RequiredError('accountId','Required parameter requestParameters.accountId was null or undefined when calling getAccountNominatorsPools.'); + if (requestParameters['accountId'] == null) { + throw new runtime.RequiredError( + 'accountId', + 'Required parameter "accountId" was null or undefined when calling getAccountNominatorsPools().' + ); } const queryParameters: any = {}; @@ -139,7 +142,7 @@ export class StakingApi extends runtime.BaseAPI implements StakingApiInterface { const headerParameters: runtime.HTTPHeaders = {}; const response = await this.request({ - path: `/v2/staking/nominator/{account_id}/pools`.replace(`{${"account_id"}}`, encodeURIComponent(String(requestParameters.accountId))), + path: `/v2/staking/nominator/{account_id}/pools`.replace(`{${"account_id"}}`, encodeURIComponent(String(requestParameters['accountId']))), method: 'GET', headers: headerParameters, query: queryParameters, @@ -160,8 +163,11 @@ export class StakingApi extends runtime.BaseAPI implements StakingApiInterface { * Pool history */ async getStakingPoolHistoryRaw(requestParameters: GetStakingPoolHistoryRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.accountId === null || requestParameters.accountId === undefined) { - throw new runtime.RequiredError('accountId','Required parameter requestParameters.accountId was null or undefined when calling getStakingPoolHistory.'); + if (requestParameters['accountId'] == null) { + throw new runtime.RequiredError( + 'accountId', + 'Required parameter "accountId" was null or undefined when calling getStakingPoolHistory().' + ); } const queryParameters: any = {}; @@ -169,7 +175,7 @@ export class StakingApi extends runtime.BaseAPI implements StakingApiInterface { const headerParameters: runtime.HTTPHeaders = {}; const response = await this.request({ - path: `/v2/staking/pool/{account_id}/history`.replace(`{${"account_id"}}`, encodeURIComponent(String(requestParameters.accountId))), + path: `/v2/staking/pool/{account_id}/history`.replace(`{${"account_id"}}`, encodeURIComponent(String(requestParameters['accountId']))), method: 'GET', headers: headerParameters, query: queryParameters, @@ -190,20 +196,23 @@ export class StakingApi extends runtime.BaseAPI implements StakingApiInterface { * Stacking pool info */ async getStakingPoolInfoRaw(requestParameters: GetStakingPoolInfoRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.accountId === null || requestParameters.accountId === undefined) { - throw new runtime.RequiredError('accountId','Required parameter requestParameters.accountId was null or undefined when calling getStakingPoolInfo.'); + if (requestParameters['accountId'] == null) { + throw new runtime.RequiredError( + 'accountId', + 'Required parameter "accountId" was null or undefined when calling getStakingPoolInfo().' + ); } const queryParameters: any = {}; const headerParameters: runtime.HTTPHeaders = {}; - if (requestParameters.acceptLanguage !== undefined && requestParameters.acceptLanguage !== null) { - headerParameters['Accept-Language'] = String(requestParameters.acceptLanguage); + if (requestParameters['acceptLanguage'] != null) { + headerParameters['Accept-Language'] = String(requestParameters['acceptLanguage']); } const response = await this.request({ - path: `/v2/staking/pool/{account_id}`.replace(`{${"account_id"}}`, encodeURIComponent(String(requestParameters.accountId))), + path: `/v2/staking/pool/{account_id}`.replace(`{${"account_id"}}`, encodeURIComponent(String(requestParameters['accountId']))), method: 'GET', headers: headerParameters, query: queryParameters, @@ -226,18 +235,18 @@ export class StakingApi extends runtime.BaseAPI implements StakingApiInterface { async getStakingPoolsRaw(requestParameters: GetStakingPoolsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { const queryParameters: any = {}; - if (requestParameters.availableFor !== undefined) { - queryParameters['available_for'] = requestParameters.availableFor; + if (requestParameters['availableFor'] != null) { + queryParameters['available_for'] = requestParameters['availableFor']; } - if (requestParameters.includeUnverified !== undefined) { - queryParameters['include_unverified'] = requestParameters.includeUnverified; + if (requestParameters['includeUnverified'] != null) { + queryParameters['include_unverified'] = requestParameters['includeUnverified']; } const headerParameters: runtime.HTTPHeaders = {}; - if (requestParameters.acceptLanguage !== undefined && requestParameters.acceptLanguage !== null) { - headerParameters['Accept-Language'] = String(requestParameters.acceptLanguage); + if (requestParameters['acceptLanguage'] != null) { + headerParameters['Accept-Language'] = String(requestParameters['acceptLanguage']); } const response = await this.request({ diff --git a/packages/core/src/tonApiV2/apis/StorageApi.ts b/packages/core/src/tonApiV2/apis/StorageApi.ts index 90fa6352a..95f352f17 100644 --- a/packages/core/src/tonApiV2/apis/StorageApi.ts +++ b/packages/core/src/tonApiV2/apis/StorageApi.ts @@ -15,14 +15,14 @@ import * as runtime from '../runtime'; import type { - GetBlockchainBlockDefaultResponse, GetStorageProviders200Response, + ReduceIndexingLatencyDefaultResponse, } from '../models/index'; import { - GetBlockchainBlockDefaultResponseFromJSON, - GetBlockchainBlockDefaultResponseToJSON, GetStorageProviders200ResponseFromJSON, GetStorageProviders200ResponseToJSON, + ReduceIndexingLatencyDefaultResponseFromJSON, + ReduceIndexingLatencyDefaultResponseToJSON, } from '../models/index'; /** diff --git a/packages/core/src/tonApiV2/apis/TracesApi.ts b/packages/core/src/tonApiV2/apis/TracesApi.ts index dfb41b8e6..b748d0f0a 100644 --- a/packages/core/src/tonApiV2/apis/TracesApi.ts +++ b/packages/core/src/tonApiV2/apis/TracesApi.ts @@ -15,12 +15,12 @@ import * as runtime from '../runtime'; import type { - GetBlockchainBlockDefaultResponse, + ReduceIndexingLatencyDefaultResponse, Trace, } from '../models/index'; import { - GetBlockchainBlockDefaultResponseFromJSON, - GetBlockchainBlockDefaultResponseToJSON, + ReduceIndexingLatencyDefaultResponseFromJSON, + ReduceIndexingLatencyDefaultResponseToJSON, TraceFromJSON, TraceToJSON, } from '../models/index'; @@ -61,8 +61,11 @@ export class TracesApi extends runtime.BaseAPI implements TracesApiInterface { * Get the trace by trace ID or hash of any transaction in trace */ async getTraceRaw(requestParameters: GetTraceRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.traceId === null || requestParameters.traceId === undefined) { - throw new runtime.RequiredError('traceId','Required parameter requestParameters.traceId was null or undefined when calling getTrace.'); + if (requestParameters['traceId'] == null) { + throw new runtime.RequiredError( + 'traceId', + 'Required parameter "traceId" was null or undefined when calling getTrace().' + ); } const queryParameters: any = {}; @@ -70,7 +73,7 @@ export class TracesApi extends runtime.BaseAPI implements TracesApiInterface { const headerParameters: runtime.HTTPHeaders = {}; const response = await this.request({ - path: `/v2/traces/{trace_id}`.replace(`{${"trace_id"}}`, encodeURIComponent(String(requestParameters.traceId))), + path: `/v2/traces/{trace_id}`.replace(`{${"trace_id"}}`, encodeURIComponent(String(requestParameters['traceId']))), method: 'GET', headers: headerParameters, query: queryParameters, diff --git a/packages/core/src/tonApiV2/apis/WalletApi.ts b/packages/core/src/tonApiV2/apis/WalletApi.ts index e6b3a0e04..24bb6433d 100644 --- a/packages/core/src/tonApiV2/apis/WalletApi.ts +++ b/packages/core/src/tonApiV2/apis/WalletApi.ts @@ -16,8 +16,8 @@ import * as runtime from '../runtime'; import type { Accounts, - GetBlockchainBlockDefaultResponse, GetWalletBackup200Response, + ReduceIndexingLatencyDefaultResponse, Seqno, TonConnectProof200Response, TonConnectProofRequest, @@ -25,10 +25,10 @@ import type { import { AccountsFromJSON, AccountsToJSON, - GetBlockchainBlockDefaultResponseFromJSON, - GetBlockchainBlockDefaultResponseToJSON, GetWalletBackup200ResponseFromJSON, GetWalletBackup200ResponseToJSON, + ReduceIndexingLatencyDefaultResponseFromJSON, + ReduceIndexingLatencyDefaultResponseToJSON, SeqnoFromJSON, SeqnoToJSON, TonConnectProof200ResponseFromJSON, @@ -147,8 +147,11 @@ export class WalletApi extends runtime.BaseAPI implements WalletApiInterface { * Get account seqno */ async getAccountSeqnoRaw(requestParameters: GetAccountSeqnoRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.accountId === null || requestParameters.accountId === undefined) { - throw new runtime.RequiredError('accountId','Required parameter requestParameters.accountId was null or undefined when calling getAccountSeqno.'); + if (requestParameters['accountId'] == null) { + throw new runtime.RequiredError( + 'accountId', + 'Required parameter "accountId" was null or undefined when calling getAccountSeqno().' + ); } const queryParameters: any = {}; @@ -156,7 +159,7 @@ export class WalletApi extends runtime.BaseAPI implements WalletApiInterface { const headerParameters: runtime.HTTPHeaders = {}; const response = await this.request({ - path: `/v2/wallet/{account_id}/seqno`.replace(`{${"account_id"}}`, encodeURIComponent(String(requestParameters.accountId))), + path: `/v2/wallet/{account_id}/seqno`.replace(`{${"account_id"}}`, encodeURIComponent(String(requestParameters['accountId']))), method: 'GET', headers: headerParameters, query: queryParameters, @@ -177,16 +180,19 @@ export class WalletApi extends runtime.BaseAPI implements WalletApiInterface { * Get backup info */ async getWalletBackupRaw(requestParameters: GetWalletBackupRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.xTonConnectAuth === null || requestParameters.xTonConnectAuth === undefined) { - throw new runtime.RequiredError('xTonConnectAuth','Required parameter requestParameters.xTonConnectAuth was null or undefined when calling getWalletBackup.'); + if (requestParameters['xTonConnectAuth'] == null) { + throw new runtime.RequiredError( + 'xTonConnectAuth', + 'Required parameter "xTonConnectAuth" was null or undefined when calling getWalletBackup().' + ); } const queryParameters: any = {}; const headerParameters: runtime.HTTPHeaders = {}; - if (requestParameters.xTonConnectAuth !== undefined && requestParameters.xTonConnectAuth !== null) { - headerParameters['X-TonConnect-Auth'] = String(requestParameters.xTonConnectAuth); + if (requestParameters['xTonConnectAuth'] != null) { + headerParameters['X-TonConnect-Auth'] = String(requestParameters['xTonConnectAuth']); } const response = await this.request({ @@ -211,8 +217,11 @@ export class WalletApi extends runtime.BaseAPI implements WalletApiInterface { * Get wallets by public key */ async getWalletsByPublicKeyRaw(requestParameters: GetWalletsByPublicKeyRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.publicKey === null || requestParameters.publicKey === undefined) { - throw new runtime.RequiredError('publicKey','Required parameter requestParameters.publicKey was null or undefined when calling getWalletsByPublicKey.'); + if (requestParameters['publicKey'] == null) { + throw new runtime.RequiredError( + 'publicKey', + 'Required parameter "publicKey" was null or undefined when calling getWalletsByPublicKey().' + ); } const queryParameters: any = {}; @@ -220,7 +229,7 @@ export class WalletApi extends runtime.BaseAPI implements WalletApiInterface { const headerParameters: runtime.HTTPHeaders = {}; const response = await this.request({ - path: `/v2/pubkeys/{public_key}/wallets`.replace(`{${"public_key"}}`, encodeURIComponent(String(requestParameters.publicKey))), + path: `/v2/pubkeys/{public_key}/wallets`.replace(`{${"public_key"}}`, encodeURIComponent(String(requestParameters['publicKey']))), method: 'GET', headers: headerParameters, query: queryParameters, @@ -241,12 +250,18 @@ export class WalletApi extends runtime.BaseAPI implements WalletApiInterface { * Set backup info */ async setWalletBackupRaw(requestParameters: SetWalletBackupRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.xTonConnectAuth === null || requestParameters.xTonConnectAuth === undefined) { - throw new runtime.RequiredError('xTonConnectAuth','Required parameter requestParameters.xTonConnectAuth was null or undefined when calling setWalletBackup.'); + if (requestParameters['xTonConnectAuth'] == null) { + throw new runtime.RequiredError( + 'xTonConnectAuth', + 'Required parameter "xTonConnectAuth" was null or undefined when calling setWalletBackup().' + ); } - if (requestParameters.body === null || requestParameters.body === undefined) { - throw new runtime.RequiredError('body','Required parameter requestParameters.body was null or undefined when calling setWalletBackup.'); + if (requestParameters['body'] == null) { + throw new runtime.RequiredError( + 'body', + 'Required parameter "body" was null or undefined when calling setWalletBackup().' + ); } const queryParameters: any = {}; @@ -255,8 +270,8 @@ export class WalletApi extends runtime.BaseAPI implements WalletApiInterface { headerParameters['Content-Type'] = 'application/octet-stream'; - if (requestParameters.xTonConnectAuth !== undefined && requestParameters.xTonConnectAuth !== null) { - headerParameters['X-TonConnect-Auth'] = String(requestParameters.xTonConnectAuth); + if (requestParameters['xTonConnectAuth'] != null) { + headerParameters['X-TonConnect-Auth'] = String(requestParameters['xTonConnectAuth']); } const response = await this.request({ @@ -264,7 +279,7 @@ export class WalletApi extends runtime.BaseAPI implements WalletApiInterface { method: 'PUT', headers: headerParameters, query: queryParameters, - body: requestParameters.body as any, + body: requestParameters['body'] as any, }, initOverrides); return new runtime.VoidApiResponse(response); @@ -281,8 +296,11 @@ export class WalletApi extends runtime.BaseAPI implements WalletApiInterface { * Account verification and token issuance */ async tonConnectProofRaw(requestParameters: TonConnectProofOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.tonConnectProofRequest === null || requestParameters.tonConnectProofRequest === undefined) { - throw new runtime.RequiredError('tonConnectProofRequest','Required parameter requestParameters.tonConnectProofRequest was null or undefined when calling tonConnectProof.'); + if (requestParameters['tonConnectProofRequest'] == null) { + throw new runtime.RequiredError( + 'tonConnectProofRequest', + 'Required parameter "tonConnectProofRequest" was null or undefined when calling tonConnectProof().' + ); } const queryParameters: any = {}; @@ -296,7 +314,7 @@ export class WalletApi extends runtime.BaseAPI implements WalletApiInterface { method: 'POST', headers: headerParameters, query: queryParameters, - body: TonConnectProofRequestToJSON(requestParameters.tonConnectProofRequest), + body: TonConnectProofRequestToJSON(requestParameters['tonConnectProofRequest']), }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => TonConnectProof200ResponseFromJSON(jsonValue)); diff --git a/packages/core/src/tonApiV2/models/Account.ts b/packages/core/src/tonApiV2/models/Account.ts index 3321ccca7..0e676fe10 100644 --- a/packages/core/src/tonApiV2/models/Account.ts +++ b/packages/core/src/tonApiV2/models/Account.ts @@ -12,7 +12,14 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; +import type { AccountStatus } from './AccountStatus'; +import { + AccountStatusFromJSON, + AccountStatusFromJSONTyped, + AccountStatusToJSON, +} from './AccountStatus'; + /** * * @export @@ -39,10 +46,10 @@ export interface Account { lastActivity: number; /** * - * @type {string} + * @type {AccountStatus} * @memberof Account */ - status: string; + status: AccountStatus; /** * * @type {Array} @@ -97,15 +104,13 @@ export interface Account { * Check if a given object implements the Account interface. */ export function instanceOfAccount(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "address" in value; - isInstance = isInstance && "balance" in value; - isInstance = isInstance && "lastActivity" in value; - isInstance = isInstance && "status" in value; - isInstance = isInstance && "getMethods" in value; - isInstance = isInstance && "isWallet" in value; - - return isInstance; + if (!('address' in value)) return false; + if (!('balance' in value)) return false; + if (!('lastActivity' in value)) return false; + if (!('status' in value)) return false; + if (!('getMethods' in value)) return false; + if (!('isWallet' in value)) return false; + return true; } export function AccountFromJSON(json: any): Account { @@ -113,7 +118,7 @@ export function AccountFromJSON(json: any): Account { } export function AccountFromJSONTyped(json: any, ignoreDiscriminator: boolean): Account { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -121,39 +126,36 @@ export function AccountFromJSONTyped(json: any, ignoreDiscriminator: boolean): A 'address': json['address'], 'balance': json['balance'], 'lastActivity': json['last_activity'], - 'status': json['status'], - 'interfaces': !exists(json, 'interfaces') ? undefined : json['interfaces'], - 'name': !exists(json, 'name') ? undefined : json['name'], - 'isScam': !exists(json, 'is_scam') ? undefined : json['is_scam'], - 'icon': !exists(json, 'icon') ? undefined : json['icon'], - 'memoRequired': !exists(json, 'memo_required') ? undefined : json['memo_required'], + 'status': AccountStatusFromJSON(json['status']), + 'interfaces': json['interfaces'] == null ? undefined : json['interfaces'], + 'name': json['name'] == null ? undefined : json['name'], + 'isScam': json['is_scam'] == null ? undefined : json['is_scam'], + 'icon': json['icon'] == null ? undefined : json['icon'], + 'memoRequired': json['memo_required'] == null ? undefined : json['memo_required'], 'getMethods': json['get_methods'], - 'isSuspended': !exists(json, 'is_suspended') ? undefined : json['is_suspended'], + 'isSuspended': json['is_suspended'] == null ? undefined : json['is_suspended'], 'isWallet': json['is_wallet'], }; } export function AccountToJSON(value?: Account | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'address': value.address, - 'balance': value.balance, - 'last_activity': value.lastActivity, - 'status': value.status, - 'interfaces': value.interfaces, - 'name': value.name, - 'is_scam': value.isScam, - 'icon': value.icon, - 'memo_required': value.memoRequired, - 'get_methods': value.getMethods, - 'is_suspended': value.isSuspended, - 'is_wallet': value.isWallet, + 'address': value['address'], + 'balance': value['balance'], + 'last_activity': value['lastActivity'], + 'status': AccountStatusToJSON(value['status']), + 'interfaces': value['interfaces'], + 'name': value['name'], + 'is_scam': value['isScam'], + 'icon': value['icon'], + 'memo_required': value['memoRequired'], + 'get_methods': value['getMethods'], + 'is_suspended': value['isSuspended'], + 'is_wallet': value['isWallet'], }; } diff --git a/packages/core/src/tonApiV2/models/AccountAddress.ts b/packages/core/src/tonApiV2/models/AccountAddress.ts index 919614d9c..b3affd8dc 100644 --- a/packages/core/src/tonApiV2/models/AccountAddress.ts +++ b/packages/core/src/tonApiV2/models/AccountAddress.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -55,12 +55,10 @@ export interface AccountAddress { * Check if a given object implements the AccountAddress interface. */ export function instanceOfAccountAddress(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "address" in value; - isInstance = isInstance && "isScam" in value; - isInstance = isInstance && "isWallet" in value; - - return isInstance; + if (!('address' in value)) return false; + if (!('isScam' in value)) return false; + if (!('isWallet' in value)) return false; + return true; } export function AccountAddressFromJSON(json: any): AccountAddress { @@ -68,33 +66,30 @@ export function AccountAddressFromJSON(json: any): AccountAddress { } export function AccountAddressFromJSONTyped(json: any, ignoreDiscriminator: boolean): AccountAddress { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'address': json['address'], - 'name': !exists(json, 'name') ? undefined : json['name'], + 'name': json['name'] == null ? undefined : json['name'], 'isScam': json['is_scam'], - 'icon': !exists(json, 'icon') ? undefined : json['icon'], + 'icon': json['icon'] == null ? undefined : json['icon'], 'isWallet': json['is_wallet'], }; } export function AccountAddressToJSON(value?: AccountAddress | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'address': value.address, - 'name': value.name, - 'is_scam': value.isScam, - 'icon': value.icon, - 'is_wallet': value.isWallet, + 'address': value['address'], + 'name': value['name'], + 'is_scam': value['isScam'], + 'icon': value['icon'], + 'is_wallet': value['isWallet'], }; } diff --git a/packages/core/src/tonApiV2/models/AccountEvent.ts b/packages/core/src/tonApiV2/models/AccountEvent.ts index 0af4fbb04..700699294 100644 --- a/packages/core/src/tonApiV2/models/AccountEvent.ts +++ b/packages/core/src/tonApiV2/models/AccountEvent.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { AccountAddress } from './AccountAddress'; import { AccountAddressFromJSON, @@ -86,17 +86,15 @@ export interface AccountEvent { * Check if a given object implements the AccountEvent interface. */ export function instanceOfAccountEvent(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "eventId" in value; - isInstance = isInstance && "account" in value; - isInstance = isInstance && "timestamp" in value; - isInstance = isInstance && "actions" in value; - isInstance = isInstance && "isScam" in value; - isInstance = isInstance && "lt" in value; - isInstance = isInstance && "inProgress" in value; - isInstance = isInstance && "extra" in value; - - return isInstance; + if (!('eventId' in value)) return false; + if (!('account' in value)) return false; + if (!('timestamp' in value)) return false; + if (!('actions' in value)) return false; + if (!('isScam' in value)) return false; + if (!('lt' in value)) return false; + if (!('inProgress' in value)) return false; + if (!('extra' in value)) return false; + return true; } export function AccountEventFromJSON(json: any): AccountEvent { @@ -104,7 +102,7 @@ export function AccountEventFromJSON(json: any): AccountEvent { } export function AccountEventFromJSONTyped(json: any, ignoreDiscriminator: boolean): AccountEvent { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -121,22 +119,19 @@ export function AccountEventFromJSONTyped(json: any, ignoreDiscriminator: boolea } export function AccountEventToJSON(value?: AccountEvent | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'event_id': value.eventId, - 'account': AccountAddressToJSON(value.account), - 'timestamp': value.timestamp, - 'actions': ((value.actions as Array).map(ActionToJSON)), - 'is_scam': value.isScam, - 'lt': value.lt, - 'in_progress': value.inProgress, - 'extra': value.extra, + 'event_id': value['eventId'], + 'account': AccountAddressToJSON(value['account']), + 'timestamp': value['timestamp'], + 'actions': ((value['actions'] as Array).map(ActionToJSON)), + 'is_scam': value['isScam'], + 'lt': value['lt'], + 'in_progress': value['inProgress'], + 'extra': value['extra'], }; } diff --git a/packages/core/src/tonApiV2/models/AccountEvents.ts b/packages/core/src/tonApiV2/models/AccountEvents.ts index 98d13aba6..dce1480e7 100644 --- a/packages/core/src/tonApiV2/models/AccountEvents.ts +++ b/packages/core/src/tonApiV2/models/AccountEvents.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { AccountEvent } from './AccountEvent'; import { AccountEventFromJSON, @@ -44,11 +44,9 @@ export interface AccountEvents { * Check if a given object implements the AccountEvents interface. */ export function instanceOfAccountEvents(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "events" in value; - isInstance = isInstance && "nextFrom" in value; - - return isInstance; + if (!('events' in value)) return false; + if (!('nextFrom' in value)) return false; + return true; } export function AccountEventsFromJSON(json: any): AccountEvents { @@ -56,7 +54,7 @@ export function AccountEventsFromJSON(json: any): AccountEvents { } export function AccountEventsFromJSONTyped(json: any, ignoreDiscriminator: boolean): AccountEvents { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -67,16 +65,13 @@ export function AccountEventsFromJSONTyped(json: any, ignoreDiscriminator: boole } export function AccountEventsToJSON(value?: AccountEvents | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'events': ((value.events as Array).map(AccountEventToJSON)), - 'next_from': value.nextFrom, + 'events': ((value['events'] as Array).map(AccountEventToJSON)), + 'next_from': value['nextFrom'], }; } diff --git a/packages/core/src/tonApiV2/models/AccountInfoByStateInit.ts b/packages/core/src/tonApiV2/models/AccountInfoByStateInit.ts index 73ebe1bf7..1ef52885d 100644 --- a/packages/core/src/tonApiV2/models/AccountInfoByStateInit.ts +++ b/packages/core/src/tonApiV2/models/AccountInfoByStateInit.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -37,11 +37,9 @@ export interface AccountInfoByStateInit { * Check if a given object implements the AccountInfoByStateInit interface. */ export function instanceOfAccountInfoByStateInit(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "publicKey" in value; - isInstance = isInstance && "address" in value; - - return isInstance; + if (!('publicKey' in value)) return false; + if (!('address' in value)) return false; + return true; } export function AccountInfoByStateInitFromJSON(json: any): AccountInfoByStateInit { @@ -49,7 +47,7 @@ export function AccountInfoByStateInitFromJSON(json: any): AccountInfoByStateIni } export function AccountInfoByStateInitFromJSONTyped(json: any, ignoreDiscriminator: boolean): AccountInfoByStateInit { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -60,16 +58,13 @@ export function AccountInfoByStateInitFromJSONTyped(json: any, ignoreDiscriminat } export function AccountInfoByStateInitToJSON(value?: AccountInfoByStateInit | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'public_key': value.publicKey, - 'address': value.address, + 'public_key': value['publicKey'], + 'address': value['address'], }; } diff --git a/packages/core/src/tonApiV2/models/AccountStaking.ts b/packages/core/src/tonApiV2/models/AccountStaking.ts index 3737f57b3..cca243731 100644 --- a/packages/core/src/tonApiV2/models/AccountStaking.ts +++ b/packages/core/src/tonApiV2/models/AccountStaking.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { AccountStakingInfo } from './AccountStakingInfo'; import { AccountStakingInfoFromJSON, @@ -38,10 +38,8 @@ export interface AccountStaking { * Check if a given object implements the AccountStaking interface. */ export function instanceOfAccountStaking(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "pools" in value; - - return isInstance; + if (!('pools' in value)) return false; + return true; } export function AccountStakingFromJSON(json: any): AccountStaking { @@ -49,7 +47,7 @@ export function AccountStakingFromJSON(json: any): AccountStaking { } export function AccountStakingFromJSONTyped(json: any, ignoreDiscriminator: boolean): AccountStaking { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -59,15 +57,12 @@ export function AccountStakingFromJSONTyped(json: any, ignoreDiscriminator: bool } export function AccountStakingToJSON(value?: AccountStaking | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'pools': ((value.pools as Array).map(AccountStakingInfoToJSON)), + 'pools': ((value['pools'] as Array).map(AccountStakingInfoToJSON)), }; } diff --git a/packages/core/src/tonApiV2/models/AccountStakingInfo.ts b/packages/core/src/tonApiV2/models/AccountStakingInfo.ts index 905b58afd..2cc1038f1 100644 --- a/packages/core/src/tonApiV2/models/AccountStakingInfo.ts +++ b/packages/core/src/tonApiV2/models/AccountStakingInfo.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -55,14 +55,12 @@ export interface AccountStakingInfo { * Check if a given object implements the AccountStakingInfo interface. */ export function instanceOfAccountStakingInfo(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "pool" in value; - isInstance = isInstance && "amount" in value; - isInstance = isInstance && "pendingDeposit" in value; - isInstance = isInstance && "pendingWithdraw" in value; - isInstance = isInstance && "readyWithdraw" in value; - - return isInstance; + if (!('pool' in value)) return false; + if (!('amount' in value)) return false; + if (!('pendingDeposit' in value)) return false; + if (!('pendingWithdraw' in value)) return false; + if (!('readyWithdraw' in value)) return false; + return true; } export function AccountStakingInfoFromJSON(json: any): AccountStakingInfo { @@ -70,7 +68,7 @@ export function AccountStakingInfoFromJSON(json: any): AccountStakingInfo { } export function AccountStakingInfoFromJSONTyped(json: any, ignoreDiscriminator: boolean): AccountStakingInfo { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -84,19 +82,16 @@ export function AccountStakingInfoFromJSONTyped(json: any, ignoreDiscriminator: } export function AccountStakingInfoToJSON(value?: AccountStakingInfo | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'pool': value.pool, - 'amount': value.amount, - 'pending_deposit': value.pendingDeposit, - 'pending_withdraw': value.pendingWithdraw, - 'ready_withdraw': value.readyWithdraw, + 'pool': value['pool'], + 'amount': value['amount'], + 'pending_deposit': value['pendingDeposit'], + 'pending_withdraw': value['pendingWithdraw'], + 'ready_withdraw': value['readyWithdraw'], }; } diff --git a/packages/core/src/tonApiV2/models/AccountStorageInfo.ts b/packages/core/src/tonApiV2/models/AccountStorageInfo.ts index d515ddda4..2fa267376 100644 --- a/packages/core/src/tonApiV2/models/AccountStorageInfo.ts +++ b/packages/core/src/tonApiV2/models/AccountStorageInfo.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -55,14 +55,12 @@ export interface AccountStorageInfo { * Check if a given object implements the AccountStorageInfo interface. */ export function instanceOfAccountStorageInfo(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "usedCells" in value; - isInstance = isInstance && "usedBits" in value; - isInstance = isInstance && "usedPublicCells" in value; - isInstance = isInstance && "lastPaid" in value; - isInstance = isInstance && "duePayment" in value; - - return isInstance; + if (!('usedCells' in value)) return false; + if (!('usedBits' in value)) return false; + if (!('usedPublicCells' in value)) return false; + if (!('lastPaid' in value)) return false; + if (!('duePayment' in value)) return false; + return true; } export function AccountStorageInfoFromJSON(json: any): AccountStorageInfo { @@ -70,7 +68,7 @@ export function AccountStorageInfoFromJSON(json: any): AccountStorageInfo { } export function AccountStorageInfoFromJSONTyped(json: any, ignoreDiscriminator: boolean): AccountStorageInfo { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -84,19 +82,16 @@ export function AccountStorageInfoFromJSONTyped(json: any, ignoreDiscriminator: } export function AccountStorageInfoToJSON(value?: AccountStorageInfo | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'used_cells': value.usedCells, - 'used_bits': value.usedBits, - 'used_public_cells': value.usedPublicCells, - 'last_paid': value.lastPaid, - 'due_payment': value.duePayment, + 'used_cells': value['usedCells'], + 'used_bits': value['usedBits'], + 'used_public_cells': value['usedPublicCells'], + 'last_paid': value['lastPaid'], + 'due_payment': value['duePayment'], }; } diff --git a/packages/core/src/tonApiV2/models/Accounts.ts b/packages/core/src/tonApiV2/models/Accounts.ts index b3c1bb260..bcd138dc0 100644 --- a/packages/core/src/tonApiV2/models/Accounts.ts +++ b/packages/core/src/tonApiV2/models/Accounts.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { Account } from './Account'; import { AccountFromJSON, @@ -38,10 +38,8 @@ export interface Accounts { * Check if a given object implements the Accounts interface. */ export function instanceOfAccounts(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "accounts" in value; - - return isInstance; + if (!('accounts' in value)) return false; + return true; } export function AccountsFromJSON(json: any): Accounts { @@ -49,7 +47,7 @@ export function AccountsFromJSON(json: any): Accounts { } export function AccountsFromJSONTyped(json: any, ignoreDiscriminator: boolean): Accounts { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -59,15 +57,12 @@ export function AccountsFromJSONTyped(json: any, ignoreDiscriminator: boolean): } export function AccountsToJSON(value?: Accounts | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'accounts': ((value.accounts as Array).map(AccountToJSON)), + 'accounts': ((value['accounts'] as Array).map(AccountToJSON)), }; } diff --git a/packages/core/src/tonApiV2/models/Action.ts b/packages/core/src/tonApiV2/models/Action.ts index 91936d83f..90e0e4cf2 100644 --- a/packages/core/src/tonApiV2/models/Action.ts +++ b/packages/core/src/tonApiV2/models/Action.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { ActionSimplePreview } from './ActionSimplePreview'; import { ActionSimplePreviewFromJSON, @@ -329,12 +329,10 @@ export type ActionStatusEnum = typeof ActionStatusEnum[keyof typeof ActionStatus * Check if a given object implements the Action interface. */ export function instanceOfAction(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "type" in value; - isInstance = isInstance && "status" in value; - isInstance = isInstance && "simplePreview" in value; - - return isInstance; + if (!('type' in value)) return false; + if (!('status' in value)) return false; + if (!('simplePreview' in value)) return false; + return true; } export function ActionFromJSON(json: any): Action { @@ -342,69 +340,66 @@ export function ActionFromJSON(json: any): Action { } export function ActionFromJSONTyped(json: any, ignoreDiscriminator: boolean): Action { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'type': json['type'], 'status': json['status'], - 'tonTransfer': !exists(json, 'TonTransfer') ? undefined : TonTransferActionFromJSON(json['TonTransfer']), - 'contractDeploy': !exists(json, 'ContractDeploy') ? undefined : ContractDeployActionFromJSON(json['ContractDeploy']), - 'jettonTransfer': !exists(json, 'JettonTransfer') ? undefined : JettonTransferActionFromJSON(json['JettonTransfer']), - 'jettonBurn': !exists(json, 'JettonBurn') ? undefined : JettonBurnActionFromJSON(json['JettonBurn']), - 'jettonMint': !exists(json, 'JettonMint') ? undefined : JettonMintActionFromJSON(json['JettonMint']), - 'nftItemTransfer': !exists(json, 'NftItemTransfer') ? undefined : NftItemTransferActionFromJSON(json['NftItemTransfer']), - 'subscribe': !exists(json, 'Subscribe') ? undefined : SubscriptionActionFromJSON(json['Subscribe']), - 'unSubscribe': !exists(json, 'UnSubscribe') ? undefined : UnSubscriptionActionFromJSON(json['UnSubscribe']), - 'auctionBid': !exists(json, 'AuctionBid') ? undefined : AuctionBidActionFromJSON(json['AuctionBid']), - 'nftPurchase': !exists(json, 'NftPurchase') ? undefined : NftPurchaseActionFromJSON(json['NftPurchase']), - 'depositStake': !exists(json, 'DepositStake') ? undefined : DepositStakeActionFromJSON(json['DepositStake']), - 'withdrawStake': !exists(json, 'WithdrawStake') ? undefined : WithdrawStakeActionFromJSON(json['WithdrawStake']), - 'withdrawStakeRequest': !exists(json, 'WithdrawStakeRequest') ? undefined : WithdrawStakeRequestActionFromJSON(json['WithdrawStakeRequest']), - 'electionsDepositStake': !exists(json, 'ElectionsDepositStake') ? undefined : ElectionsDepositStakeActionFromJSON(json['ElectionsDepositStake']), - 'electionsRecoverStake': !exists(json, 'ElectionsRecoverStake') ? undefined : ElectionsRecoverStakeActionFromJSON(json['ElectionsRecoverStake']), - 'jettonSwap': !exists(json, 'JettonSwap') ? undefined : JettonSwapActionFromJSON(json['JettonSwap']), - 'smartContractExec': !exists(json, 'SmartContractExec') ? undefined : SmartContractActionFromJSON(json['SmartContractExec']), - 'domainRenew': !exists(json, 'DomainRenew') ? undefined : DomainRenewActionFromJSON(json['DomainRenew']), - 'inscriptionTransfer': !exists(json, 'InscriptionTransfer') ? undefined : InscriptionTransferActionFromJSON(json['InscriptionTransfer']), - 'inscriptionMint': !exists(json, 'InscriptionMint') ? undefined : InscriptionMintActionFromJSON(json['InscriptionMint']), + 'tonTransfer': json['TonTransfer'] == null ? undefined : TonTransferActionFromJSON(json['TonTransfer']), + 'contractDeploy': json['ContractDeploy'] == null ? undefined : ContractDeployActionFromJSON(json['ContractDeploy']), + 'jettonTransfer': json['JettonTransfer'] == null ? undefined : JettonTransferActionFromJSON(json['JettonTransfer']), + 'jettonBurn': json['JettonBurn'] == null ? undefined : JettonBurnActionFromJSON(json['JettonBurn']), + 'jettonMint': json['JettonMint'] == null ? undefined : JettonMintActionFromJSON(json['JettonMint']), + 'nftItemTransfer': json['NftItemTransfer'] == null ? undefined : NftItemTransferActionFromJSON(json['NftItemTransfer']), + 'subscribe': json['Subscribe'] == null ? undefined : SubscriptionActionFromJSON(json['Subscribe']), + 'unSubscribe': json['UnSubscribe'] == null ? undefined : UnSubscriptionActionFromJSON(json['UnSubscribe']), + 'auctionBid': json['AuctionBid'] == null ? undefined : AuctionBidActionFromJSON(json['AuctionBid']), + 'nftPurchase': json['NftPurchase'] == null ? undefined : NftPurchaseActionFromJSON(json['NftPurchase']), + 'depositStake': json['DepositStake'] == null ? undefined : DepositStakeActionFromJSON(json['DepositStake']), + 'withdrawStake': json['WithdrawStake'] == null ? undefined : WithdrawStakeActionFromJSON(json['WithdrawStake']), + 'withdrawStakeRequest': json['WithdrawStakeRequest'] == null ? undefined : WithdrawStakeRequestActionFromJSON(json['WithdrawStakeRequest']), + 'electionsDepositStake': json['ElectionsDepositStake'] == null ? undefined : ElectionsDepositStakeActionFromJSON(json['ElectionsDepositStake']), + 'electionsRecoverStake': json['ElectionsRecoverStake'] == null ? undefined : ElectionsRecoverStakeActionFromJSON(json['ElectionsRecoverStake']), + 'jettonSwap': json['JettonSwap'] == null ? undefined : JettonSwapActionFromJSON(json['JettonSwap']), + 'smartContractExec': json['SmartContractExec'] == null ? undefined : SmartContractActionFromJSON(json['SmartContractExec']), + 'domainRenew': json['DomainRenew'] == null ? undefined : DomainRenewActionFromJSON(json['DomainRenew']), + 'inscriptionTransfer': json['InscriptionTransfer'] == null ? undefined : InscriptionTransferActionFromJSON(json['InscriptionTransfer']), + 'inscriptionMint': json['InscriptionMint'] == null ? undefined : InscriptionMintActionFromJSON(json['InscriptionMint']), 'simplePreview': ActionSimplePreviewFromJSON(json['simple_preview']), }; } export function ActionToJSON(value?: Action | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'type': value.type, - 'status': value.status, - 'TonTransfer': TonTransferActionToJSON(value.tonTransfer), - 'ContractDeploy': ContractDeployActionToJSON(value.contractDeploy), - 'JettonTransfer': JettonTransferActionToJSON(value.jettonTransfer), - 'JettonBurn': JettonBurnActionToJSON(value.jettonBurn), - 'JettonMint': JettonMintActionToJSON(value.jettonMint), - 'NftItemTransfer': NftItemTransferActionToJSON(value.nftItemTransfer), - 'Subscribe': SubscriptionActionToJSON(value.subscribe), - 'UnSubscribe': UnSubscriptionActionToJSON(value.unSubscribe), - 'AuctionBid': AuctionBidActionToJSON(value.auctionBid), - 'NftPurchase': NftPurchaseActionToJSON(value.nftPurchase), - 'DepositStake': DepositStakeActionToJSON(value.depositStake), - 'WithdrawStake': WithdrawStakeActionToJSON(value.withdrawStake), - 'WithdrawStakeRequest': WithdrawStakeRequestActionToJSON(value.withdrawStakeRequest), - 'ElectionsDepositStake': ElectionsDepositStakeActionToJSON(value.electionsDepositStake), - 'ElectionsRecoverStake': ElectionsRecoverStakeActionToJSON(value.electionsRecoverStake), - 'JettonSwap': JettonSwapActionToJSON(value.jettonSwap), - 'SmartContractExec': SmartContractActionToJSON(value.smartContractExec), - 'DomainRenew': DomainRenewActionToJSON(value.domainRenew), - 'InscriptionTransfer': InscriptionTransferActionToJSON(value.inscriptionTransfer), - 'InscriptionMint': InscriptionMintActionToJSON(value.inscriptionMint), - 'simple_preview': ActionSimplePreviewToJSON(value.simplePreview), + 'type': value['type'], + 'status': value['status'], + 'TonTransfer': TonTransferActionToJSON(value['tonTransfer']), + 'ContractDeploy': ContractDeployActionToJSON(value['contractDeploy']), + 'JettonTransfer': JettonTransferActionToJSON(value['jettonTransfer']), + 'JettonBurn': JettonBurnActionToJSON(value['jettonBurn']), + 'JettonMint': JettonMintActionToJSON(value['jettonMint']), + 'NftItemTransfer': NftItemTransferActionToJSON(value['nftItemTransfer']), + 'Subscribe': SubscriptionActionToJSON(value['subscribe']), + 'UnSubscribe': UnSubscriptionActionToJSON(value['unSubscribe']), + 'AuctionBid': AuctionBidActionToJSON(value['auctionBid']), + 'NftPurchase': NftPurchaseActionToJSON(value['nftPurchase']), + 'DepositStake': DepositStakeActionToJSON(value['depositStake']), + 'WithdrawStake': WithdrawStakeActionToJSON(value['withdrawStake']), + 'WithdrawStakeRequest': WithdrawStakeRequestActionToJSON(value['withdrawStakeRequest']), + 'ElectionsDepositStake': ElectionsDepositStakeActionToJSON(value['electionsDepositStake']), + 'ElectionsRecoverStake': ElectionsRecoverStakeActionToJSON(value['electionsRecoverStake']), + 'JettonSwap': JettonSwapActionToJSON(value['jettonSwap']), + 'SmartContractExec': SmartContractActionToJSON(value['smartContractExec']), + 'DomainRenew': DomainRenewActionToJSON(value['domainRenew']), + 'InscriptionTransfer': InscriptionTransferActionToJSON(value['inscriptionTransfer']), + 'InscriptionMint': InscriptionMintActionToJSON(value['inscriptionMint']), + 'simple_preview': ActionSimplePreviewToJSON(value['simplePreview']), }; } diff --git a/packages/core/src/tonApiV2/models/ActionPhase.ts b/packages/core/src/tonApiV2/models/ActionPhase.ts index b4f7f9921..2891182eb 100644 --- a/packages/core/src/tonApiV2/models/ActionPhase.ts +++ b/packages/core/src/tonApiV2/models/ActionPhase.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -61,15 +61,13 @@ export interface ActionPhase { * Check if a given object implements the ActionPhase interface. */ export function instanceOfActionPhase(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "success" in value; - isInstance = isInstance && "resultCode" in value; - isInstance = isInstance && "totalActions" in value; - isInstance = isInstance && "skippedActions" in value; - isInstance = isInstance && "fwdFees" in value; - isInstance = isInstance && "totalFees" in value; - - return isInstance; + if (!('success' in value)) return false; + if (!('resultCode' in value)) return false; + if (!('totalActions' in value)) return false; + if (!('skippedActions' in value)) return false; + if (!('fwdFees' in value)) return false; + if (!('totalFees' in value)) return false; + return true; } export function ActionPhaseFromJSON(json: any): ActionPhase { @@ -77,7 +75,7 @@ export function ActionPhaseFromJSON(json: any): ActionPhase { } export function ActionPhaseFromJSONTyped(json: any, ignoreDiscriminator: boolean): ActionPhase { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -92,20 +90,17 @@ export function ActionPhaseFromJSONTyped(json: any, ignoreDiscriminator: boolean } export function ActionPhaseToJSON(value?: ActionPhase | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'success': value.success, - 'result_code': value.resultCode, - 'total_actions': value.totalActions, - 'skipped_actions': value.skippedActions, - 'fwd_fees': value.fwdFees, - 'total_fees': value.totalFees, + 'success': value['success'], + 'result_code': value['resultCode'], + 'total_actions': value['totalActions'], + 'skipped_actions': value['skippedActions'], + 'fwd_fees': value['fwdFees'], + 'total_fees': value['totalFees'], }; } diff --git a/packages/core/src/tonApiV2/models/ActionSimplePreview.ts b/packages/core/src/tonApiV2/models/ActionSimplePreview.ts index 9cfc016a2..aa369e36e 100644 --- a/packages/core/src/tonApiV2/models/ActionSimplePreview.ts +++ b/packages/core/src/tonApiV2/models/ActionSimplePreview.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { AccountAddress } from './AccountAddress'; import { AccountAddressFromJSON, @@ -68,12 +68,10 @@ export interface ActionSimplePreview { * Check if a given object implements the ActionSimplePreview interface. */ export function instanceOfActionSimplePreview(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "name" in value; - isInstance = isInstance && "description" in value; - isInstance = isInstance && "accounts" in value; - - return isInstance; + if (!('name' in value)) return false; + if (!('description' in value)) return false; + if (!('accounts' in value)) return false; + return true; } export function ActionSimplePreviewFromJSON(json: any): ActionSimplePreview { @@ -81,35 +79,32 @@ export function ActionSimplePreviewFromJSON(json: any): ActionSimplePreview { } export function ActionSimplePreviewFromJSONTyped(json: any, ignoreDiscriminator: boolean): ActionSimplePreview { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'name': json['name'], 'description': json['description'], - 'actionImage': !exists(json, 'action_image') ? undefined : json['action_image'], - 'value': !exists(json, 'value') ? undefined : json['value'], - 'valueImage': !exists(json, 'value_image') ? undefined : json['value_image'], + 'actionImage': json['action_image'] == null ? undefined : json['action_image'], + 'value': json['value'] == null ? undefined : json['value'], + 'valueImage': json['value_image'] == null ? undefined : json['value_image'], 'accounts': ((json['accounts'] as Array).map(AccountAddressFromJSON)), }; } export function ActionSimplePreviewToJSON(value?: ActionSimplePreview | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'name': value.name, - 'description': value.description, - 'action_image': value.actionImage, - 'value': value.value, - 'value_image': value.valueImage, - 'accounts': ((value.accounts as Array).map(AccountAddressToJSON)), + 'name': value['name'], + 'description': value['description'], + 'action_image': value['actionImage'], + 'value': value['value'], + 'value_image': value['valueImage'], + 'accounts': ((value['accounts'] as Array).map(AccountAddressToJSON)), }; } diff --git a/packages/core/src/tonApiV2/models/AddressParse200Response.ts b/packages/core/src/tonApiV2/models/AddressParse200Response.ts index 8f732a2bc..4ef0f671f 100644 --- a/packages/core/src/tonApiV2/models/AddressParse200Response.ts +++ b/packages/core/src/tonApiV2/models/AddressParse200Response.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { AddressParse200ResponseBounceable } from './AddressParse200ResponseBounceable'; import { AddressParse200ResponseBounceableFromJSON, @@ -62,14 +62,12 @@ export interface AddressParse200Response { * Check if a given object implements the AddressParse200Response interface. */ export function instanceOfAddressParse200Response(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "rawForm" in value; - isInstance = isInstance && "bounceable" in value; - isInstance = isInstance && "nonBounceable" in value; - isInstance = isInstance && "givenType" in value; - isInstance = isInstance && "testOnly" in value; - - return isInstance; + if (!('rawForm' in value)) return false; + if (!('bounceable' in value)) return false; + if (!('nonBounceable' in value)) return false; + if (!('givenType' in value)) return false; + if (!('testOnly' in value)) return false; + return true; } export function AddressParse200ResponseFromJSON(json: any): AddressParse200Response { @@ -77,7 +75,7 @@ export function AddressParse200ResponseFromJSON(json: any): AddressParse200Respo } export function AddressParse200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): AddressParse200Response { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -91,19 +89,16 @@ export function AddressParse200ResponseFromJSONTyped(json: any, ignoreDiscrimina } export function AddressParse200ResponseToJSON(value?: AddressParse200Response | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'raw_form': value.rawForm, - 'bounceable': AddressParse200ResponseBounceableToJSON(value.bounceable), - 'non_bounceable': AddressParse200ResponseBounceableToJSON(value.nonBounceable), - 'given_type': value.givenType, - 'test_only': value.testOnly, + 'raw_form': value['rawForm'], + 'bounceable': AddressParse200ResponseBounceableToJSON(value['bounceable']), + 'non_bounceable': AddressParse200ResponseBounceableToJSON(value['nonBounceable']), + 'given_type': value['givenType'], + 'test_only': value['testOnly'], }; } diff --git a/packages/core/src/tonApiV2/models/AddressParse200ResponseBounceable.ts b/packages/core/src/tonApiV2/models/AddressParse200ResponseBounceable.ts index 4c1d827a8..0cf2f64b4 100644 --- a/packages/core/src/tonApiV2/models/AddressParse200ResponseBounceable.ts +++ b/packages/core/src/tonApiV2/models/AddressParse200ResponseBounceable.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -37,11 +37,9 @@ export interface AddressParse200ResponseBounceable { * Check if a given object implements the AddressParse200ResponseBounceable interface. */ export function instanceOfAddressParse200ResponseBounceable(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "b64" in value; - isInstance = isInstance && "b64url" in value; - - return isInstance; + if (!('b64' in value)) return false; + if (!('b64url' in value)) return false; + return true; } export function AddressParse200ResponseBounceableFromJSON(json: any): AddressParse200ResponseBounceable { @@ -49,7 +47,7 @@ export function AddressParse200ResponseBounceableFromJSON(json: any): AddressPar } export function AddressParse200ResponseBounceableFromJSONTyped(json: any, ignoreDiscriminator: boolean): AddressParse200ResponseBounceable { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -60,16 +58,13 @@ export function AddressParse200ResponseBounceableFromJSONTyped(json: any, ignore } export function AddressParse200ResponseBounceableToJSON(value?: AddressParse200ResponseBounceable | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'b64': value.b64, - 'b64url': value.b64url, + 'b64': value['b64'], + 'b64url': value['b64url'], }; } diff --git a/packages/core/src/tonApiV2/models/ApyHistory.ts b/packages/core/src/tonApiV2/models/ApyHistory.ts index d55839fae..ea11e3bd8 100644 --- a/packages/core/src/tonApiV2/models/ApyHistory.ts +++ b/packages/core/src/tonApiV2/models/ApyHistory.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -37,11 +37,9 @@ export interface ApyHistory { * Check if a given object implements the ApyHistory interface. */ export function instanceOfApyHistory(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "apy" in value; - isInstance = isInstance && "time" in value; - - return isInstance; + if (!('apy' in value)) return false; + if (!('time' in value)) return false; + return true; } export function ApyHistoryFromJSON(json: any): ApyHistory { @@ -49,7 +47,7 @@ export function ApyHistoryFromJSON(json: any): ApyHistory { } export function ApyHistoryFromJSONTyped(json: any, ignoreDiscriminator: boolean): ApyHistory { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -60,16 +58,13 @@ export function ApyHistoryFromJSONTyped(json: any, ignoreDiscriminator: boolean) } export function ApyHistoryToJSON(value?: ApyHistory | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'apy': value.apy, - 'time': value.time, + 'apy': value['apy'], + 'time': value['time'], }; } diff --git a/packages/core/src/tonApiV2/models/Auction.ts b/packages/core/src/tonApiV2/models/Auction.ts index 03d8854a5..a3cc0955d 100644 --- a/packages/core/src/tonApiV2/models/Auction.ts +++ b/packages/core/src/tonApiV2/models/Auction.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -55,14 +55,12 @@ export interface Auction { * Check if a given object implements the Auction interface. */ export function instanceOfAuction(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "domain" in value; - isInstance = isInstance && "owner" in value; - isInstance = isInstance && "price" in value; - isInstance = isInstance && "bids" in value; - isInstance = isInstance && "date" in value; - - return isInstance; + if (!('domain' in value)) return false; + if (!('owner' in value)) return false; + if (!('price' in value)) return false; + if (!('bids' in value)) return false; + if (!('date' in value)) return false; + return true; } export function AuctionFromJSON(json: any): Auction { @@ -70,7 +68,7 @@ export function AuctionFromJSON(json: any): Auction { } export function AuctionFromJSONTyped(json: any, ignoreDiscriminator: boolean): Auction { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -84,19 +82,16 @@ export function AuctionFromJSONTyped(json: any, ignoreDiscriminator: boolean): A } export function AuctionToJSON(value?: Auction | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'domain': value.domain, - 'owner': value.owner, - 'price': value.price, - 'bids': value.bids, - 'date': value.date, + 'domain': value['domain'], + 'owner': value['owner'], + 'price': value['price'], + 'bids': value['bids'], + 'date': value['date'], }; } diff --git a/packages/core/src/tonApiV2/models/AuctionBidAction.ts b/packages/core/src/tonApiV2/models/AuctionBidAction.ts index ea39810c9..d938e0059 100644 --- a/packages/core/src/tonApiV2/models/AuctionBidAction.ts +++ b/packages/core/src/tonApiV2/models/AuctionBidAction.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { AccountAddress } from './AccountAddress'; import { AccountAddressFromJSON, @@ -87,13 +87,11 @@ export type AuctionBidActionAuctionTypeEnum = typeof AuctionBidActionAuctionType * Check if a given object implements the AuctionBidAction interface. */ export function instanceOfAuctionBidAction(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "auctionType" in value; - isInstance = isInstance && "amount" in value; - isInstance = isInstance && "bidder" in value; - isInstance = isInstance && "auction" in value; - - return isInstance; + if (!('auctionType' in value)) return false; + if (!('amount' in value)) return false; + if (!('bidder' in value)) return false; + if (!('auction' in value)) return false; + return true; } export function AuctionBidActionFromJSON(json: any): AuctionBidAction { @@ -101,33 +99,30 @@ export function AuctionBidActionFromJSON(json: any): AuctionBidAction { } export function AuctionBidActionFromJSONTyped(json: any, ignoreDiscriminator: boolean): AuctionBidAction { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'auctionType': json['auction_type'], 'amount': PriceFromJSON(json['amount']), - 'nft': !exists(json, 'nft') ? undefined : NftItemFromJSON(json['nft']), + 'nft': json['nft'] == null ? undefined : NftItemFromJSON(json['nft']), 'bidder': AccountAddressFromJSON(json['bidder']), 'auction': AccountAddressFromJSON(json['auction']), }; } export function AuctionBidActionToJSON(value?: AuctionBidAction | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'auction_type': value.auctionType, - 'amount': PriceToJSON(value.amount), - 'nft': NftItemToJSON(value.nft), - 'bidder': AccountAddressToJSON(value.bidder), - 'auction': AccountAddressToJSON(value.auction), + 'auction_type': value['auctionType'], + 'amount': PriceToJSON(value['amount']), + 'nft': NftItemToJSON(value['nft']), + 'bidder': AccountAddressToJSON(value['bidder']), + 'auction': AccountAddressToJSON(value['auction']), }; } diff --git a/packages/core/src/tonApiV2/models/Auctions.ts b/packages/core/src/tonApiV2/models/Auctions.ts index 4680e9b85..7d0ada21b 100644 --- a/packages/core/src/tonApiV2/models/Auctions.ts +++ b/packages/core/src/tonApiV2/models/Auctions.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { Auction } from './Auction'; import { AuctionFromJSON, @@ -44,11 +44,9 @@ export interface Auctions { * Check if a given object implements the Auctions interface. */ export function instanceOfAuctions(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "data" in value; - isInstance = isInstance && "total" in value; - - return isInstance; + if (!('data' in value)) return false; + if (!('total' in value)) return false; + return true; } export function AuctionsFromJSON(json: any): Auctions { @@ -56,7 +54,7 @@ export function AuctionsFromJSON(json: any): Auctions { } export function AuctionsFromJSONTyped(json: any, ignoreDiscriminator: boolean): Auctions { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -67,16 +65,13 @@ export function AuctionsFromJSONTyped(json: any, ignoreDiscriminator: boolean): } export function AuctionsToJSON(value?: Auctions | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'data': ((value.data as Array).map(AuctionToJSON)), - 'total': value.total, + 'data': ((value['data'] as Array).map(AuctionToJSON)), + 'total': value['total'], }; } diff --git a/packages/core/src/tonApiV2/models/BlockCurrencyCollection.ts b/packages/core/src/tonApiV2/models/BlockCurrencyCollection.ts index 472d325df..d3a300633 100644 --- a/packages/core/src/tonApiV2/models/BlockCurrencyCollection.ts +++ b/packages/core/src/tonApiV2/models/BlockCurrencyCollection.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { BlockCurrencyCollectionOtherInner } from './BlockCurrencyCollectionOtherInner'; import { BlockCurrencyCollectionOtherInnerFromJSON, @@ -44,11 +44,9 @@ export interface BlockCurrencyCollection { * Check if a given object implements the BlockCurrencyCollection interface. */ export function instanceOfBlockCurrencyCollection(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "grams" in value; - isInstance = isInstance && "other" in value; - - return isInstance; + if (!('grams' in value)) return false; + if (!('other' in value)) return false; + return true; } export function BlockCurrencyCollectionFromJSON(json: any): BlockCurrencyCollection { @@ -56,7 +54,7 @@ export function BlockCurrencyCollectionFromJSON(json: any): BlockCurrencyCollect } export function BlockCurrencyCollectionFromJSONTyped(json: any, ignoreDiscriminator: boolean): BlockCurrencyCollection { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -67,16 +65,13 @@ export function BlockCurrencyCollectionFromJSONTyped(json: any, ignoreDiscrimina } export function BlockCurrencyCollectionToJSON(value?: BlockCurrencyCollection | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'grams': value.grams, - 'other': ((value.other as Array).map(BlockCurrencyCollectionOtherInnerToJSON)), + 'grams': value['grams'], + 'other': ((value['other'] as Array).map(BlockCurrencyCollectionOtherInnerToJSON)), }; } diff --git a/packages/core/src/tonApiV2/models/BlockCurrencyCollectionOtherInner.ts b/packages/core/src/tonApiV2/models/BlockCurrencyCollectionOtherInner.ts index 90b644fdd..7c909f94a 100644 --- a/packages/core/src/tonApiV2/models/BlockCurrencyCollectionOtherInner.ts +++ b/packages/core/src/tonApiV2/models/BlockCurrencyCollectionOtherInner.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -37,11 +37,9 @@ export interface BlockCurrencyCollectionOtherInner { * Check if a given object implements the BlockCurrencyCollectionOtherInner interface. */ export function instanceOfBlockCurrencyCollectionOtherInner(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "id" in value; - isInstance = isInstance && "value" in value; - - return isInstance; + if (!('id' in value)) return false; + if (!('value' in value)) return false; + return true; } export function BlockCurrencyCollectionOtherInnerFromJSON(json: any): BlockCurrencyCollectionOtherInner { @@ -49,7 +47,7 @@ export function BlockCurrencyCollectionOtherInnerFromJSON(json: any): BlockCurre } export function BlockCurrencyCollectionOtherInnerFromJSONTyped(json: any, ignoreDiscriminator: boolean): BlockCurrencyCollectionOtherInner { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -60,16 +58,13 @@ export function BlockCurrencyCollectionOtherInnerFromJSONTyped(json: any, ignore } export function BlockCurrencyCollectionOtherInnerToJSON(value?: BlockCurrencyCollectionOtherInner | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'id': value.id, - 'value': value.value, + 'id': value['id'], + 'value': value['value'], }; } diff --git a/packages/core/src/tonApiV2/models/BlockLimits.ts b/packages/core/src/tonApiV2/models/BlockLimits.ts index 5c9c8b8f3..cc1d3efce 100644 --- a/packages/core/src/tonApiV2/models/BlockLimits.ts +++ b/packages/core/src/tonApiV2/models/BlockLimits.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { BlockParamLimits } from './BlockParamLimits'; import { BlockParamLimitsFromJSON, @@ -50,12 +50,10 @@ export interface BlockLimits { * Check if a given object implements the BlockLimits interface. */ export function instanceOfBlockLimits(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "bytes" in value; - isInstance = isInstance && "gas" in value; - isInstance = isInstance && "ltDelta" in value; - - return isInstance; + if (!('bytes' in value)) return false; + if (!('gas' in value)) return false; + if (!('ltDelta' in value)) return false; + return true; } export function BlockLimitsFromJSON(json: any): BlockLimits { @@ -63,7 +61,7 @@ export function BlockLimitsFromJSON(json: any): BlockLimits { } export function BlockLimitsFromJSONTyped(json: any, ignoreDiscriminator: boolean): BlockLimits { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -75,17 +73,14 @@ export function BlockLimitsFromJSONTyped(json: any, ignoreDiscriminator: boolean } export function BlockLimitsToJSON(value?: BlockLimits | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'bytes': BlockParamLimitsToJSON(value.bytes), - 'gas': BlockParamLimitsToJSON(value.gas), - 'lt_delta': BlockParamLimitsToJSON(value.ltDelta), + 'bytes': BlockParamLimitsToJSON(value['bytes']), + 'gas': BlockParamLimitsToJSON(value['gas']), + 'lt_delta': BlockParamLimitsToJSON(value['ltDelta']), }; } diff --git a/packages/core/src/tonApiV2/models/BlockParamLimits.ts b/packages/core/src/tonApiV2/models/BlockParamLimits.ts index 6c87d8342..fab8c8bec 100644 --- a/packages/core/src/tonApiV2/models/BlockParamLimits.ts +++ b/packages/core/src/tonApiV2/models/BlockParamLimits.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -43,12 +43,10 @@ export interface BlockParamLimits { * Check if a given object implements the BlockParamLimits interface. */ export function instanceOfBlockParamLimits(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "underload" in value; - isInstance = isInstance && "softLimit" in value; - isInstance = isInstance && "hardLimit" in value; - - return isInstance; + if (!('underload' in value)) return false; + if (!('softLimit' in value)) return false; + if (!('hardLimit' in value)) return false; + return true; } export function BlockParamLimitsFromJSON(json: any): BlockParamLimits { @@ -56,7 +54,7 @@ export function BlockParamLimitsFromJSON(json: any): BlockParamLimits { } export function BlockParamLimitsFromJSONTyped(json: any, ignoreDiscriminator: boolean): BlockParamLimits { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -68,17 +66,14 @@ export function BlockParamLimitsFromJSONTyped(json: any, ignoreDiscriminator: bo } export function BlockParamLimitsToJSON(value?: BlockParamLimits | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'underload': value.underload, - 'soft_limit': value.softLimit, - 'hard_limit': value.hardLimit, + 'underload': value['underload'], + 'soft_limit': value['softLimit'], + 'hard_limit': value['hardLimit'], }; } diff --git a/packages/core/src/tonApiV2/models/BlockRaw.ts b/packages/core/src/tonApiV2/models/BlockRaw.ts index 4cd9deca3..096390de4 100644 --- a/packages/core/src/tonApiV2/models/BlockRaw.ts +++ b/packages/core/src/tonApiV2/models/BlockRaw.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -27,10 +27,10 @@ export interface BlockRaw { workchain: number; /** * - * @type {number} + * @type {string} * @memberof BlockRaw */ - shard: number; + shard: string; /** * * @type {number} @@ -55,14 +55,12 @@ export interface BlockRaw { * Check if a given object implements the BlockRaw interface. */ export function instanceOfBlockRaw(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "workchain" in value; - isInstance = isInstance && "shard" in value; - isInstance = isInstance && "seqno" in value; - isInstance = isInstance && "rootHash" in value; - isInstance = isInstance && "fileHash" in value; - - return isInstance; + if (!('workchain' in value)) return false; + if (!('shard' in value)) return false; + if (!('seqno' in value)) return false; + if (!('rootHash' in value)) return false; + if (!('fileHash' in value)) return false; + return true; } export function BlockRawFromJSON(json: any): BlockRaw { @@ -70,7 +68,7 @@ export function BlockRawFromJSON(json: any): BlockRaw { } export function BlockRawFromJSONTyped(json: any, ignoreDiscriminator: boolean): BlockRaw { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -84,19 +82,16 @@ export function BlockRawFromJSONTyped(json: any, ignoreDiscriminator: boolean): } export function BlockRawToJSON(value?: BlockRaw | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'workchain': value.workchain, - 'shard': value.shard, - 'seqno': value.seqno, - 'root_hash': value.rootHash, - 'file_hash': value.fileHash, + 'workchain': value['workchain'], + 'shard': value['shard'], + 'seqno': value['seqno'], + 'root_hash': value['rootHash'], + 'file_hash': value['fileHash'], }; } diff --git a/packages/core/src/tonApiV2/models/BlockValueFlow.ts b/packages/core/src/tonApiV2/models/BlockValueFlow.ts index 764c1d29c..ca5acbf8b 100644 --- a/packages/core/src/tonApiV2/models/BlockValueFlow.ts +++ b/packages/core/src/tonApiV2/models/BlockValueFlow.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { BlockCurrencyCollection } from './BlockCurrencyCollection'; import { BlockCurrencyCollectionFromJSON, @@ -92,18 +92,16 @@ export interface BlockValueFlow { * Check if a given object implements the BlockValueFlow interface. */ export function instanceOfBlockValueFlow(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "fromPrevBlk" in value; - isInstance = isInstance && "toNextBlk" in value; - isInstance = isInstance && "imported" in value; - isInstance = isInstance && "exported" in value; - isInstance = isInstance && "feesCollected" in value; - isInstance = isInstance && "feesImported" in value; - isInstance = isInstance && "recovered" in value; - isInstance = isInstance && "created" in value; - isInstance = isInstance && "minted" in value; - - return isInstance; + if (!('fromPrevBlk' in value)) return false; + if (!('toNextBlk' in value)) return false; + if (!('imported' in value)) return false; + if (!('exported' in value)) return false; + if (!('feesCollected' in value)) return false; + if (!('feesImported' in value)) return false; + if (!('recovered' in value)) return false; + if (!('created' in value)) return false; + if (!('minted' in value)) return false; + return true; } export function BlockValueFlowFromJSON(json: any): BlockValueFlow { @@ -111,7 +109,7 @@ export function BlockValueFlowFromJSON(json: any): BlockValueFlow { } export function BlockValueFlowFromJSONTyped(json: any, ignoreDiscriminator: boolean): BlockValueFlow { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -121,7 +119,7 @@ export function BlockValueFlowFromJSONTyped(json: any, ignoreDiscriminator: bool 'imported': BlockCurrencyCollectionFromJSON(json['imported']), 'exported': BlockCurrencyCollectionFromJSON(json['exported']), 'feesCollected': BlockCurrencyCollectionFromJSON(json['fees_collected']), - 'burned': !exists(json, 'burned') ? undefined : BlockCurrencyCollectionFromJSON(json['burned']), + 'burned': json['burned'] == null ? undefined : BlockCurrencyCollectionFromJSON(json['burned']), 'feesImported': BlockCurrencyCollectionFromJSON(json['fees_imported']), 'recovered': BlockCurrencyCollectionFromJSON(json['recovered']), 'created': BlockCurrencyCollectionFromJSON(json['created']), @@ -130,24 +128,21 @@ export function BlockValueFlowFromJSONTyped(json: any, ignoreDiscriminator: bool } export function BlockValueFlowToJSON(value?: BlockValueFlow | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'from_prev_blk': BlockCurrencyCollectionToJSON(value.fromPrevBlk), - 'to_next_blk': BlockCurrencyCollectionToJSON(value.toNextBlk), - 'imported': BlockCurrencyCollectionToJSON(value.imported), - 'exported': BlockCurrencyCollectionToJSON(value.exported), - 'fees_collected': BlockCurrencyCollectionToJSON(value.feesCollected), - 'burned': BlockCurrencyCollectionToJSON(value.burned), - 'fees_imported': BlockCurrencyCollectionToJSON(value.feesImported), - 'recovered': BlockCurrencyCollectionToJSON(value.recovered), - 'created': BlockCurrencyCollectionToJSON(value.created), - 'minted': BlockCurrencyCollectionToJSON(value.minted), + 'from_prev_blk': BlockCurrencyCollectionToJSON(value['fromPrevBlk']), + 'to_next_blk': BlockCurrencyCollectionToJSON(value['toNextBlk']), + 'imported': BlockCurrencyCollectionToJSON(value['imported']), + 'exported': BlockCurrencyCollectionToJSON(value['exported']), + 'fees_collected': BlockCurrencyCollectionToJSON(value['feesCollected']), + 'burned': BlockCurrencyCollectionToJSON(value['burned']), + 'fees_imported': BlockCurrencyCollectionToJSON(value['feesImported']), + 'recovered': BlockCurrencyCollectionToJSON(value['recovered']), + 'created': BlockCurrencyCollectionToJSON(value['created']), + 'minted': BlockCurrencyCollectionToJSON(value['minted']), }; } diff --git a/packages/core/src/tonApiV2/models/BlockchainAccountInspect.ts b/packages/core/src/tonApiV2/models/BlockchainAccountInspect.ts index 31948f8e8..1a5ba3672 100644 --- a/packages/core/src/tonApiV2/models/BlockchainAccountInspect.ts +++ b/packages/core/src/tonApiV2/models/BlockchainAccountInspect.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { BlockchainAccountInspectMethodsInner } from './BlockchainAccountInspectMethodsInner'; import { BlockchainAccountInspectMethodsInnerFromJSON, @@ -66,12 +66,10 @@ export type BlockchainAccountInspectCompilerEnum = typeof BlockchainAccountInspe * Check if a given object implements the BlockchainAccountInspect interface. */ export function instanceOfBlockchainAccountInspect(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "code" in value; - isInstance = isInstance && "codeHash" in value; - isInstance = isInstance && "methods" in value; - - return isInstance; + if (!('code' in value)) return false; + if (!('codeHash' in value)) return false; + if (!('methods' in value)) return false; + return true; } export function BlockchainAccountInspectFromJSON(json: any): BlockchainAccountInspect { @@ -79,7 +77,7 @@ export function BlockchainAccountInspectFromJSON(json: any): BlockchainAccountIn } export function BlockchainAccountInspectFromJSONTyped(json: any, ignoreDiscriminator: boolean): BlockchainAccountInspect { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -87,23 +85,20 @@ export function BlockchainAccountInspectFromJSONTyped(json: any, ignoreDiscrimin 'code': json['code'], 'codeHash': json['code_hash'], 'methods': ((json['methods'] as Array).map(BlockchainAccountInspectMethodsInnerFromJSON)), - 'compiler': !exists(json, 'compiler') ? undefined : json['compiler'], + 'compiler': json['compiler'] == null ? undefined : json['compiler'], }; } export function BlockchainAccountInspectToJSON(value?: BlockchainAccountInspect | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'code': value.code, - 'code_hash': value.codeHash, - 'methods': ((value.methods as Array).map(BlockchainAccountInspectMethodsInnerToJSON)), - 'compiler': value.compiler, + 'code': value['code'], + 'code_hash': value['codeHash'], + 'methods': ((value['methods'] as Array).map(BlockchainAccountInspectMethodsInnerToJSON)), + 'compiler': value['compiler'], }; } diff --git a/packages/core/src/tonApiV2/models/BlockchainAccountInspectMethodsInner.ts b/packages/core/src/tonApiV2/models/BlockchainAccountInspectMethodsInner.ts index 67e13c02f..f664845c8 100644 --- a/packages/core/src/tonApiV2/models/BlockchainAccountInspectMethodsInner.ts +++ b/packages/core/src/tonApiV2/models/BlockchainAccountInspectMethodsInner.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -37,11 +37,9 @@ export interface BlockchainAccountInspectMethodsInner { * Check if a given object implements the BlockchainAccountInspectMethodsInner interface. */ export function instanceOfBlockchainAccountInspectMethodsInner(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "id" in value; - isInstance = isInstance && "method" in value; - - return isInstance; + if (!('id' in value)) return false; + if (!('method' in value)) return false; + return true; } export function BlockchainAccountInspectMethodsInnerFromJSON(json: any): BlockchainAccountInspectMethodsInner { @@ -49,7 +47,7 @@ export function BlockchainAccountInspectMethodsInnerFromJSON(json: any): Blockch } export function BlockchainAccountInspectMethodsInnerFromJSONTyped(json: any, ignoreDiscriminator: boolean): BlockchainAccountInspectMethodsInner { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -60,16 +58,13 @@ export function BlockchainAccountInspectMethodsInnerFromJSONTyped(json: any, ign } export function BlockchainAccountInspectMethodsInnerToJSON(value?: BlockchainAccountInspectMethodsInner | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'id': value.id, - 'method': value.method, + 'id': value['id'], + 'method': value['method'], }; } diff --git a/packages/core/src/tonApiV2/models/BlockchainBlock.ts b/packages/core/src/tonApiV2/models/BlockchainBlock.ts index 827a41dec..f279cf41d 100644 --- a/packages/core/src/tonApiV2/models/BlockchainBlock.ts +++ b/packages/core/src/tonApiV2/models/BlockchainBlock.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { BlockValueFlow } from './BlockValueFlow'; import { BlockValueFlowFromJSON, @@ -212,36 +212,34 @@ export interface BlockchainBlock { * Check if a given object implements the BlockchainBlock interface. */ export function instanceOfBlockchainBlock(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "txQuantity" in value; - isInstance = isInstance && "valueFlow" in value; - isInstance = isInstance && "workchainId" in value; - isInstance = isInstance && "shard" in value; - isInstance = isInstance && "seqno" in value; - isInstance = isInstance && "rootHash" in value; - isInstance = isInstance && "fileHash" in value; - isInstance = isInstance && "globalId" in value; - isInstance = isInstance && "version" in value; - isInstance = isInstance && "afterMerge" in value; - isInstance = isInstance && "beforeSplit" in value; - isInstance = isInstance && "afterSplit" in value; - isInstance = isInstance && "wantSplit" in value; - isInstance = isInstance && "wantMerge" in value; - isInstance = isInstance && "keyBlock" in value; - isInstance = isInstance && "genUtime" in value; - isInstance = isInstance && "startLt" in value; - isInstance = isInstance && "endLt" in value; - isInstance = isInstance && "vertSeqno" in value; - isInstance = isInstance && "genCatchainSeqno" in value; - isInstance = isInstance && "minRefMcSeqno" in value; - isInstance = isInstance && "prevKeyBlockSeqno" in value; - isInstance = isInstance && "prevRefs" in value; - isInstance = isInstance && "inMsgDescrLength" in value; - isInstance = isInstance && "outMsgDescrLength" in value; - isInstance = isInstance && "randSeed" in value; - isInstance = isInstance && "createdBy" in value; - - return isInstance; + if (!('txQuantity' in value)) return false; + if (!('valueFlow' in value)) return false; + if (!('workchainId' in value)) return false; + if (!('shard' in value)) return false; + if (!('seqno' in value)) return false; + if (!('rootHash' in value)) return false; + if (!('fileHash' in value)) return false; + if (!('globalId' in value)) return false; + if (!('version' in value)) return false; + if (!('afterMerge' in value)) return false; + if (!('beforeSplit' in value)) return false; + if (!('afterSplit' in value)) return false; + if (!('wantSplit' in value)) return false; + if (!('wantMerge' in value)) return false; + if (!('keyBlock' in value)) return false; + if (!('genUtime' in value)) return false; + if (!('startLt' in value)) return false; + if (!('endLt' in value)) return false; + if (!('vertSeqno' in value)) return false; + if (!('genCatchainSeqno' in value)) return false; + if (!('minRefMcSeqno' in value)) return false; + if (!('prevKeyBlockSeqno' in value)) return false; + if (!('prevRefs' in value)) return false; + if (!('inMsgDescrLength' in value)) return false; + if (!('outMsgDescrLength' in value)) return false; + if (!('randSeed' in value)) return false; + if (!('createdBy' in value)) return false; + return true; } export function BlockchainBlockFromJSON(json: any): BlockchainBlock { @@ -249,7 +247,7 @@ export function BlockchainBlockFromJSON(json: any): BlockchainBlock { } export function BlockchainBlockFromJSONTyped(json: any, ignoreDiscriminator: boolean): BlockchainBlock { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -276,9 +274,9 @@ export function BlockchainBlockFromJSONTyped(json: any, ignoreDiscriminator: boo 'genCatchainSeqno': json['gen_catchain_seqno'], 'minRefMcSeqno': json['min_ref_mc_seqno'], 'prevKeyBlockSeqno': json['prev_key_block_seqno'], - 'genSoftwareVersion': !exists(json, 'gen_software_version') ? undefined : json['gen_software_version'], - 'genSoftwareCapabilities': !exists(json, 'gen_software_capabilities') ? undefined : json['gen_software_capabilities'], - 'masterRef': !exists(json, 'master_ref') ? undefined : json['master_ref'], + 'genSoftwareVersion': json['gen_software_version'] == null ? undefined : json['gen_software_version'], + 'genSoftwareCapabilities': json['gen_software_capabilities'] == null ? undefined : json['gen_software_capabilities'], + 'masterRef': json['master_ref'] == null ? undefined : json['master_ref'], 'prevRefs': json['prev_refs'], 'inMsgDescrLength': json['in_msg_descr_length'], 'outMsgDescrLength': json['out_msg_descr_length'], @@ -288,44 +286,41 @@ export function BlockchainBlockFromJSONTyped(json: any, ignoreDiscriminator: boo } export function BlockchainBlockToJSON(value?: BlockchainBlock | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'tx_quantity': value.txQuantity, - 'value_flow': BlockValueFlowToJSON(value.valueFlow), - 'workchain_id': value.workchainId, - 'shard': value.shard, - 'seqno': value.seqno, - 'root_hash': value.rootHash, - 'file_hash': value.fileHash, - 'global_id': value.globalId, - 'version': value.version, - 'after_merge': value.afterMerge, - 'before_split': value.beforeSplit, - 'after_split': value.afterSplit, - 'want_split': value.wantSplit, - 'want_merge': value.wantMerge, - 'key_block': value.keyBlock, - 'gen_utime': value.genUtime, - 'start_lt': value.startLt, - 'end_lt': value.endLt, - 'vert_seqno': value.vertSeqno, - 'gen_catchain_seqno': value.genCatchainSeqno, - 'min_ref_mc_seqno': value.minRefMcSeqno, - 'prev_key_block_seqno': value.prevKeyBlockSeqno, - 'gen_software_version': value.genSoftwareVersion, - 'gen_software_capabilities': value.genSoftwareCapabilities, - 'master_ref': value.masterRef, - 'prev_refs': value.prevRefs, - 'in_msg_descr_length': value.inMsgDescrLength, - 'out_msg_descr_length': value.outMsgDescrLength, - 'rand_seed': value.randSeed, - 'created_by': value.createdBy, + 'tx_quantity': value['txQuantity'], + 'value_flow': BlockValueFlowToJSON(value['valueFlow']), + 'workchain_id': value['workchainId'], + 'shard': value['shard'], + 'seqno': value['seqno'], + 'root_hash': value['rootHash'], + 'file_hash': value['fileHash'], + 'global_id': value['globalId'], + 'version': value['version'], + 'after_merge': value['afterMerge'], + 'before_split': value['beforeSplit'], + 'after_split': value['afterSplit'], + 'want_split': value['wantSplit'], + 'want_merge': value['wantMerge'], + 'key_block': value['keyBlock'], + 'gen_utime': value['genUtime'], + 'start_lt': value['startLt'], + 'end_lt': value['endLt'], + 'vert_seqno': value['vertSeqno'], + 'gen_catchain_seqno': value['genCatchainSeqno'], + 'min_ref_mc_seqno': value['minRefMcSeqno'], + 'prev_key_block_seqno': value['prevKeyBlockSeqno'], + 'gen_software_version': value['genSoftwareVersion'], + 'gen_software_capabilities': value['genSoftwareCapabilities'], + 'master_ref': value['masterRef'], + 'prev_refs': value['prevRefs'], + 'in_msg_descr_length': value['inMsgDescrLength'], + 'out_msg_descr_length': value['outMsgDescrLength'], + 'rand_seed': value['randSeed'], + 'created_by': value['createdBy'], }; } diff --git a/packages/core/src/tonApiV2/models/BlockchainBlockShards.ts b/packages/core/src/tonApiV2/models/BlockchainBlockShards.ts index ee8b01fa8..eb03b334e 100644 --- a/packages/core/src/tonApiV2/models/BlockchainBlockShards.ts +++ b/packages/core/src/tonApiV2/models/BlockchainBlockShards.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { BlockchainBlockShardsShardsInner } from './BlockchainBlockShardsShardsInner'; import { BlockchainBlockShardsShardsInnerFromJSON, @@ -38,10 +38,8 @@ export interface BlockchainBlockShards { * Check if a given object implements the BlockchainBlockShards interface. */ export function instanceOfBlockchainBlockShards(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "shards" in value; - - return isInstance; + if (!('shards' in value)) return false; + return true; } export function BlockchainBlockShardsFromJSON(json: any): BlockchainBlockShards { @@ -49,7 +47,7 @@ export function BlockchainBlockShardsFromJSON(json: any): BlockchainBlockShards } export function BlockchainBlockShardsFromJSONTyped(json: any, ignoreDiscriminator: boolean): BlockchainBlockShards { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -59,15 +57,12 @@ export function BlockchainBlockShardsFromJSONTyped(json: any, ignoreDiscriminato } export function BlockchainBlockShardsToJSON(value?: BlockchainBlockShards | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'shards': ((value.shards as Array).map(BlockchainBlockShardsShardsInnerToJSON)), + 'shards': ((value['shards'] as Array).map(BlockchainBlockShardsShardsInnerToJSON)), }; } diff --git a/packages/core/src/tonApiV2/models/BlockchainBlockShardsShardsInner.ts b/packages/core/src/tonApiV2/models/BlockchainBlockShardsShardsInner.ts index 2ab115b7f..9470503ae 100644 --- a/packages/core/src/tonApiV2/models/BlockchainBlockShardsShardsInner.ts +++ b/packages/core/src/tonApiV2/models/BlockchainBlockShardsShardsInner.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -31,10 +31,8 @@ export interface BlockchainBlockShardsShardsInner { * Check if a given object implements the BlockchainBlockShardsShardsInner interface. */ export function instanceOfBlockchainBlockShardsShardsInner(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "lastKnownBlockId" in value; - - return isInstance; + if (!('lastKnownBlockId' in value)) return false; + return true; } export function BlockchainBlockShardsShardsInnerFromJSON(json: any): BlockchainBlockShardsShardsInner { @@ -42,7 +40,7 @@ export function BlockchainBlockShardsShardsInnerFromJSON(json: any): BlockchainB } export function BlockchainBlockShardsShardsInnerFromJSONTyped(json: any, ignoreDiscriminator: boolean): BlockchainBlockShardsShardsInner { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -52,15 +50,12 @@ export function BlockchainBlockShardsShardsInnerFromJSONTyped(json: any, ignoreD } export function BlockchainBlockShardsShardsInnerToJSON(value?: BlockchainBlockShardsShardsInner | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'last_known_block_id': value.lastKnownBlockId, + 'last_known_block_id': value['lastKnownBlockId'], }; } diff --git a/packages/core/src/tonApiV2/models/BlockchainBlocks.ts b/packages/core/src/tonApiV2/models/BlockchainBlocks.ts index 6f22682a6..0ad415268 100644 --- a/packages/core/src/tonApiV2/models/BlockchainBlocks.ts +++ b/packages/core/src/tonApiV2/models/BlockchainBlocks.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { BlockchainBlock } from './BlockchainBlock'; import { BlockchainBlockFromJSON, @@ -38,10 +38,8 @@ export interface BlockchainBlocks { * Check if a given object implements the BlockchainBlocks interface. */ export function instanceOfBlockchainBlocks(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "blocks" in value; - - return isInstance; + if (!('blocks' in value)) return false; + return true; } export function BlockchainBlocksFromJSON(json: any): BlockchainBlocks { @@ -49,7 +47,7 @@ export function BlockchainBlocksFromJSON(json: any): BlockchainBlocks { } export function BlockchainBlocksFromJSONTyped(json: any, ignoreDiscriminator: boolean): BlockchainBlocks { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -59,15 +57,12 @@ export function BlockchainBlocksFromJSONTyped(json: any, ignoreDiscriminator: bo } export function BlockchainBlocksToJSON(value?: BlockchainBlocks | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'blocks': ((value.blocks as Array).map(BlockchainBlockToJSON)), + 'blocks': ((value['blocks'] as Array).map(BlockchainBlockToJSON)), }; } diff --git a/packages/core/src/tonApiV2/models/BlockchainConfig.ts b/packages/core/src/tonApiV2/models/BlockchainConfig.ts index 648ecdf6f..04b2f9802 100644 --- a/packages/core/src/tonApiV2/models/BlockchainConfig.ts +++ b/packages/core/src/tonApiV2/models/BlockchainConfig.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { BlockchainConfig10 } from './BlockchainConfig10'; import { BlockchainConfig10FromJSON, @@ -464,15 +464,13 @@ export interface BlockchainConfig { * Check if a given object implements the BlockchainConfig interface. */ export function instanceOfBlockchainConfig(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "raw" in value; - isInstance = isInstance && "_0" in value; - isInstance = isInstance && "_1" in value; - isInstance = isInstance && "_2" in value; - isInstance = isInstance && "_4" in value; - isInstance = isInstance && "_44" in value; - - return isInstance; + if (!('raw' in value)) return false; + if (!('_0' in value)) return false; + if (!('_1' in value)) return false; + if (!('_2' in value)) return false; + if (!('_4' in value)) return false; + if (!('_44' in value)) return false; + return true; } export function BlockchainConfigFromJSON(json: any): BlockchainConfig { @@ -480,7 +478,7 @@ export function BlockchainConfigFromJSON(json: any): BlockchainConfig { } export function BlockchainConfigFromJSONTyped(json: any, ignoreDiscriminator: boolean): BlockchainConfig { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -489,102 +487,99 @@ export function BlockchainConfigFromJSONTyped(json: any, ignoreDiscriminator: bo '_0': json['0'], '_1': json['1'], '_2': json['2'], - '_3': !exists(json, '3') ? undefined : json['3'], + '_3': json['3'] == null ? undefined : json['3'], '_4': json['4'], - '_5': !exists(json, '5') ? undefined : BlockchainConfig5FromJSON(json['5']), - '_6': !exists(json, '6') ? undefined : BlockchainConfig6FromJSON(json['6']), - '_7': !exists(json, '7') ? undefined : BlockchainConfig7FromJSON(json['7']), - '_8': !exists(json, '8') ? undefined : BlockchainConfig8FromJSON(json['8']), - '_9': !exists(json, '9') ? undefined : BlockchainConfig9FromJSON(json['9']), - '_10': !exists(json, '10') ? undefined : BlockchainConfig10FromJSON(json['10']), - '_11': !exists(json, '11') ? undefined : BlockchainConfig11FromJSON(json['11']), - '_12': !exists(json, '12') ? undefined : BlockchainConfig12FromJSON(json['12']), - '_13': !exists(json, '13') ? undefined : BlockchainConfig13FromJSON(json['13']), - '_14': !exists(json, '14') ? undefined : BlockchainConfig14FromJSON(json['14']), - '_15': !exists(json, '15') ? undefined : BlockchainConfig15FromJSON(json['15']), - '_16': !exists(json, '16') ? undefined : BlockchainConfig16FromJSON(json['16']), - '_17': !exists(json, '17') ? undefined : BlockchainConfig17FromJSON(json['17']), - '_18': !exists(json, '18') ? undefined : BlockchainConfig18FromJSON(json['18']), - '_20': !exists(json, '20') ? undefined : BlockchainConfig20FromJSON(json['20']), - '_21': !exists(json, '21') ? undefined : BlockchainConfig21FromJSON(json['21']), - '_22': !exists(json, '22') ? undefined : BlockchainConfig22FromJSON(json['22']), - '_23': !exists(json, '23') ? undefined : BlockchainConfig23FromJSON(json['23']), - '_24': !exists(json, '24') ? undefined : BlockchainConfig24FromJSON(json['24']), - '_25': !exists(json, '25') ? undefined : BlockchainConfig25FromJSON(json['25']), - '_28': !exists(json, '28') ? undefined : BlockchainConfig28FromJSON(json['28']), - '_29': !exists(json, '29') ? undefined : BlockchainConfig29FromJSON(json['29']), - '_31': !exists(json, '31') ? undefined : BlockchainConfig31FromJSON(json['31']), - '_32': !exists(json, '32') ? undefined : ValidatorsSetFromJSON(json['32']), - '_33': !exists(json, '33') ? undefined : ValidatorsSetFromJSON(json['33']), - '_34': !exists(json, '34') ? undefined : ValidatorsSetFromJSON(json['34']), - '_35': !exists(json, '35') ? undefined : ValidatorsSetFromJSON(json['35']), - '_36': !exists(json, '36') ? undefined : ValidatorsSetFromJSON(json['36']), - '_37': !exists(json, '37') ? undefined : ValidatorsSetFromJSON(json['37']), - '_40': !exists(json, '40') ? undefined : BlockchainConfig40FromJSON(json['40']), - '_43': !exists(json, '43') ? undefined : BlockchainConfig43FromJSON(json['43']), + '_5': json['5'] == null ? undefined : BlockchainConfig5FromJSON(json['5']), + '_6': json['6'] == null ? undefined : BlockchainConfig6FromJSON(json['6']), + '_7': json['7'] == null ? undefined : BlockchainConfig7FromJSON(json['7']), + '_8': json['8'] == null ? undefined : BlockchainConfig8FromJSON(json['8']), + '_9': json['9'] == null ? undefined : BlockchainConfig9FromJSON(json['9']), + '_10': json['10'] == null ? undefined : BlockchainConfig10FromJSON(json['10']), + '_11': json['11'] == null ? undefined : BlockchainConfig11FromJSON(json['11']), + '_12': json['12'] == null ? undefined : BlockchainConfig12FromJSON(json['12']), + '_13': json['13'] == null ? undefined : BlockchainConfig13FromJSON(json['13']), + '_14': json['14'] == null ? undefined : BlockchainConfig14FromJSON(json['14']), + '_15': json['15'] == null ? undefined : BlockchainConfig15FromJSON(json['15']), + '_16': json['16'] == null ? undefined : BlockchainConfig16FromJSON(json['16']), + '_17': json['17'] == null ? undefined : BlockchainConfig17FromJSON(json['17']), + '_18': json['18'] == null ? undefined : BlockchainConfig18FromJSON(json['18']), + '_20': json['20'] == null ? undefined : BlockchainConfig20FromJSON(json['20']), + '_21': json['21'] == null ? undefined : BlockchainConfig21FromJSON(json['21']), + '_22': json['22'] == null ? undefined : BlockchainConfig22FromJSON(json['22']), + '_23': json['23'] == null ? undefined : BlockchainConfig23FromJSON(json['23']), + '_24': json['24'] == null ? undefined : BlockchainConfig24FromJSON(json['24']), + '_25': json['25'] == null ? undefined : BlockchainConfig25FromJSON(json['25']), + '_28': json['28'] == null ? undefined : BlockchainConfig28FromJSON(json['28']), + '_29': json['29'] == null ? undefined : BlockchainConfig29FromJSON(json['29']), + '_31': json['31'] == null ? undefined : BlockchainConfig31FromJSON(json['31']), + '_32': json['32'] == null ? undefined : ValidatorsSetFromJSON(json['32']), + '_33': json['33'] == null ? undefined : ValidatorsSetFromJSON(json['33']), + '_34': json['34'] == null ? undefined : ValidatorsSetFromJSON(json['34']), + '_35': json['35'] == null ? undefined : ValidatorsSetFromJSON(json['35']), + '_36': json['36'] == null ? undefined : ValidatorsSetFromJSON(json['36']), + '_37': json['37'] == null ? undefined : ValidatorsSetFromJSON(json['37']), + '_40': json['40'] == null ? undefined : BlockchainConfig40FromJSON(json['40']), + '_43': json['43'] == null ? undefined : BlockchainConfig43FromJSON(json['43']), '_44': BlockchainConfig44FromJSON(json['44']), - '_71': !exists(json, '71') ? undefined : BlockchainConfig71FromJSON(json['71']), - '_72': !exists(json, '72') ? undefined : BlockchainConfig71FromJSON(json['72']), - '_73': !exists(json, '73') ? undefined : BlockchainConfig71FromJSON(json['73']), - '_79': !exists(json, '79') ? undefined : BlockchainConfig79FromJSON(json['79']), - '_81': !exists(json, '81') ? undefined : BlockchainConfig79FromJSON(json['81']), - '_82': !exists(json, '82') ? undefined : BlockchainConfig79FromJSON(json['82']), + '_71': json['71'] == null ? undefined : BlockchainConfig71FromJSON(json['71']), + '_72': json['72'] == null ? undefined : BlockchainConfig71FromJSON(json['72']), + '_73': json['73'] == null ? undefined : BlockchainConfig71FromJSON(json['73']), + '_79': json['79'] == null ? undefined : BlockchainConfig79FromJSON(json['79']), + '_81': json['81'] == null ? undefined : BlockchainConfig79FromJSON(json['81']), + '_82': json['82'] == null ? undefined : BlockchainConfig79FromJSON(json['82']), }; } export function BlockchainConfigToJSON(value?: BlockchainConfig | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'raw': value.raw, - '0': value._0, - '1': value._1, - '2': value._2, - '3': value._3, - '4': value._4, - '5': BlockchainConfig5ToJSON(value._5), - '6': BlockchainConfig6ToJSON(value._6), - '7': BlockchainConfig7ToJSON(value._7), - '8': BlockchainConfig8ToJSON(value._8), - '9': BlockchainConfig9ToJSON(value._9), - '10': BlockchainConfig10ToJSON(value._10), - '11': BlockchainConfig11ToJSON(value._11), - '12': BlockchainConfig12ToJSON(value._12), - '13': BlockchainConfig13ToJSON(value._13), - '14': BlockchainConfig14ToJSON(value._14), - '15': BlockchainConfig15ToJSON(value._15), - '16': BlockchainConfig16ToJSON(value._16), - '17': BlockchainConfig17ToJSON(value._17), - '18': BlockchainConfig18ToJSON(value._18), - '20': BlockchainConfig20ToJSON(value._20), - '21': BlockchainConfig21ToJSON(value._21), - '22': BlockchainConfig22ToJSON(value._22), - '23': BlockchainConfig23ToJSON(value._23), - '24': BlockchainConfig24ToJSON(value._24), - '25': BlockchainConfig25ToJSON(value._25), - '28': BlockchainConfig28ToJSON(value._28), - '29': BlockchainConfig29ToJSON(value._29), - '31': BlockchainConfig31ToJSON(value._31), - '32': ValidatorsSetToJSON(value._32), - '33': ValidatorsSetToJSON(value._33), - '34': ValidatorsSetToJSON(value._34), - '35': ValidatorsSetToJSON(value._35), - '36': ValidatorsSetToJSON(value._36), - '37': ValidatorsSetToJSON(value._37), - '40': BlockchainConfig40ToJSON(value._40), - '43': BlockchainConfig43ToJSON(value._43), - '44': BlockchainConfig44ToJSON(value._44), - '71': BlockchainConfig71ToJSON(value._71), - '72': BlockchainConfig71ToJSON(value._72), - '73': BlockchainConfig71ToJSON(value._73), - '79': BlockchainConfig79ToJSON(value._79), - '81': BlockchainConfig79ToJSON(value._81), - '82': BlockchainConfig79ToJSON(value._82), + 'raw': value['raw'], + '0': value['_0'], + '1': value['_1'], + '2': value['_2'], + '3': value['_3'], + '4': value['_4'], + '5': BlockchainConfig5ToJSON(value['_5']), + '6': BlockchainConfig6ToJSON(value['_6']), + '7': BlockchainConfig7ToJSON(value['_7']), + '8': BlockchainConfig8ToJSON(value['_8']), + '9': BlockchainConfig9ToJSON(value['_9']), + '10': BlockchainConfig10ToJSON(value['_10']), + '11': BlockchainConfig11ToJSON(value['_11']), + '12': BlockchainConfig12ToJSON(value['_12']), + '13': BlockchainConfig13ToJSON(value['_13']), + '14': BlockchainConfig14ToJSON(value['_14']), + '15': BlockchainConfig15ToJSON(value['_15']), + '16': BlockchainConfig16ToJSON(value['_16']), + '17': BlockchainConfig17ToJSON(value['_17']), + '18': BlockchainConfig18ToJSON(value['_18']), + '20': BlockchainConfig20ToJSON(value['_20']), + '21': BlockchainConfig21ToJSON(value['_21']), + '22': BlockchainConfig22ToJSON(value['_22']), + '23': BlockchainConfig23ToJSON(value['_23']), + '24': BlockchainConfig24ToJSON(value['_24']), + '25': BlockchainConfig25ToJSON(value['_25']), + '28': BlockchainConfig28ToJSON(value['_28']), + '29': BlockchainConfig29ToJSON(value['_29']), + '31': BlockchainConfig31ToJSON(value['_31']), + '32': ValidatorsSetToJSON(value['_32']), + '33': ValidatorsSetToJSON(value['_33']), + '34': ValidatorsSetToJSON(value['_34']), + '35': ValidatorsSetToJSON(value['_35']), + '36': ValidatorsSetToJSON(value['_36']), + '37': ValidatorsSetToJSON(value['_37']), + '40': BlockchainConfig40ToJSON(value['_40']), + '43': BlockchainConfig43ToJSON(value['_43']), + '44': BlockchainConfig44ToJSON(value['_44']), + '71': BlockchainConfig71ToJSON(value['_71']), + '72': BlockchainConfig71ToJSON(value['_72']), + '73': BlockchainConfig71ToJSON(value['_73']), + '79': BlockchainConfig79ToJSON(value['_79']), + '81': BlockchainConfig79ToJSON(value['_81']), + '82': BlockchainConfig79ToJSON(value['_82']), }; } diff --git a/packages/core/src/tonApiV2/models/BlockchainConfig10.ts b/packages/core/src/tonApiV2/models/BlockchainConfig10.ts index e6ba08a17..f7ab8a95c 100644 --- a/packages/core/src/tonApiV2/models/BlockchainConfig10.ts +++ b/packages/core/src/tonApiV2/models/BlockchainConfig10.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * List of critical TON parameters, the change of which significantly affects the network, so more voting rounds are held. * @export @@ -31,10 +31,8 @@ export interface BlockchainConfig10 { * Check if a given object implements the BlockchainConfig10 interface. */ export function instanceOfBlockchainConfig10(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "criticalParams" in value; - - return isInstance; + if (!('criticalParams' in value)) return false; + return true; } export function BlockchainConfig10FromJSON(json: any): BlockchainConfig10 { @@ -42,7 +40,7 @@ export function BlockchainConfig10FromJSON(json: any): BlockchainConfig10 { } export function BlockchainConfig10FromJSONTyped(json: any, ignoreDiscriminator: boolean): BlockchainConfig10 { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -52,15 +50,12 @@ export function BlockchainConfig10FromJSONTyped(json: any, ignoreDiscriminator: } export function BlockchainConfig10ToJSON(value?: BlockchainConfig10 | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'critical_params': value.criticalParams, + 'critical_params': value['criticalParams'], }; } diff --git a/packages/core/src/tonApiV2/models/BlockchainConfig11.ts b/packages/core/src/tonApiV2/models/BlockchainConfig11.ts index d4761bb9b..16b9a4b64 100644 --- a/packages/core/src/tonApiV2/models/BlockchainConfig11.ts +++ b/packages/core/src/tonApiV2/models/BlockchainConfig11.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { ConfigProposalSetup } from './ConfigProposalSetup'; import { ConfigProposalSetupFromJSON, @@ -44,11 +44,9 @@ export interface BlockchainConfig11 { * Check if a given object implements the BlockchainConfig11 interface. */ export function instanceOfBlockchainConfig11(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "normalParams" in value; - isInstance = isInstance && "criticalParams" in value; - - return isInstance; + if (!('normalParams' in value)) return false; + if (!('criticalParams' in value)) return false; + return true; } export function BlockchainConfig11FromJSON(json: any): BlockchainConfig11 { @@ -56,7 +54,7 @@ export function BlockchainConfig11FromJSON(json: any): BlockchainConfig11 { } export function BlockchainConfig11FromJSONTyped(json: any, ignoreDiscriminator: boolean): BlockchainConfig11 { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -67,16 +65,13 @@ export function BlockchainConfig11FromJSONTyped(json: any, ignoreDiscriminator: } export function BlockchainConfig11ToJSON(value?: BlockchainConfig11 | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'normal_params': ConfigProposalSetupToJSON(value.normalParams), - 'critical_params': ConfigProposalSetupToJSON(value.criticalParams), + 'normal_params': ConfigProposalSetupToJSON(value['normalParams']), + 'critical_params': ConfigProposalSetupToJSON(value['criticalParams']), }; } diff --git a/packages/core/src/tonApiV2/models/BlockchainConfig12.ts b/packages/core/src/tonApiV2/models/BlockchainConfig12.ts index d8f79c478..58281ff71 100644 --- a/packages/core/src/tonApiV2/models/BlockchainConfig12.ts +++ b/packages/core/src/tonApiV2/models/BlockchainConfig12.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { WorkchainDescr } from './WorkchainDescr'; import { WorkchainDescrFromJSON, @@ -38,10 +38,8 @@ export interface BlockchainConfig12 { * Check if a given object implements the BlockchainConfig12 interface. */ export function instanceOfBlockchainConfig12(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "workchains" in value; - - return isInstance; + if (!('workchains' in value)) return false; + return true; } export function BlockchainConfig12FromJSON(json: any): BlockchainConfig12 { @@ -49,7 +47,7 @@ export function BlockchainConfig12FromJSON(json: any): BlockchainConfig12 { } export function BlockchainConfig12FromJSONTyped(json: any, ignoreDiscriminator: boolean): BlockchainConfig12 { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -59,15 +57,12 @@ export function BlockchainConfig12FromJSONTyped(json: any, ignoreDiscriminator: } export function BlockchainConfig12ToJSON(value?: BlockchainConfig12 | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'workchains': ((value.workchains as Array).map(WorkchainDescrToJSON)), + 'workchains': ((value['workchains'] as Array).map(WorkchainDescrToJSON)), }; } diff --git a/packages/core/src/tonApiV2/models/BlockchainConfig13.ts b/packages/core/src/tonApiV2/models/BlockchainConfig13.ts index 4edb325d1..4eb4757e3 100644 --- a/packages/core/src/tonApiV2/models/BlockchainConfig13.ts +++ b/packages/core/src/tonApiV2/models/BlockchainConfig13.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * The cost of filing complaints about incorrect operation of validators. * @export @@ -43,12 +43,10 @@ export interface BlockchainConfig13 { * Check if a given object implements the BlockchainConfig13 interface. */ export function instanceOfBlockchainConfig13(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "deposit" in value; - isInstance = isInstance && "bitPrice" in value; - isInstance = isInstance && "cellPrice" in value; - - return isInstance; + if (!('deposit' in value)) return false; + if (!('bitPrice' in value)) return false; + if (!('cellPrice' in value)) return false; + return true; } export function BlockchainConfig13FromJSON(json: any): BlockchainConfig13 { @@ -56,7 +54,7 @@ export function BlockchainConfig13FromJSON(json: any): BlockchainConfig13 { } export function BlockchainConfig13FromJSONTyped(json: any, ignoreDiscriminator: boolean): BlockchainConfig13 { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -68,17 +66,14 @@ export function BlockchainConfig13FromJSONTyped(json: any, ignoreDiscriminator: } export function BlockchainConfig13ToJSON(value?: BlockchainConfig13 | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'deposit': value.deposit, - 'bit_price': value.bitPrice, - 'cell_price': value.cellPrice, + 'deposit': value['deposit'], + 'bit_price': value['bitPrice'], + 'cell_price': value['cellPrice'], }; } diff --git a/packages/core/src/tonApiV2/models/BlockchainConfig14.ts b/packages/core/src/tonApiV2/models/BlockchainConfig14.ts index a86455a71..8588ba587 100644 --- a/packages/core/src/tonApiV2/models/BlockchainConfig14.ts +++ b/packages/core/src/tonApiV2/models/BlockchainConfig14.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * The reward in nanoTons for block creation in the TON blockchain. * @export @@ -37,11 +37,9 @@ export interface BlockchainConfig14 { * Check if a given object implements the BlockchainConfig14 interface. */ export function instanceOfBlockchainConfig14(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "masterchainBlockFee" in value; - isInstance = isInstance && "basechainBlockFee" in value; - - return isInstance; + if (!('masterchainBlockFee' in value)) return false; + if (!('basechainBlockFee' in value)) return false; + return true; } export function BlockchainConfig14FromJSON(json: any): BlockchainConfig14 { @@ -49,7 +47,7 @@ export function BlockchainConfig14FromJSON(json: any): BlockchainConfig14 { } export function BlockchainConfig14FromJSONTyped(json: any, ignoreDiscriminator: boolean): BlockchainConfig14 { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -60,16 +58,13 @@ export function BlockchainConfig14FromJSONTyped(json: any, ignoreDiscriminator: } export function BlockchainConfig14ToJSON(value?: BlockchainConfig14 | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'masterchain_block_fee': value.masterchainBlockFee, - 'basechain_block_fee': value.basechainBlockFee, + 'masterchain_block_fee': value['masterchainBlockFee'], + 'basechain_block_fee': value['basechainBlockFee'], }; } diff --git a/packages/core/src/tonApiV2/models/BlockchainConfig15.ts b/packages/core/src/tonApiV2/models/BlockchainConfig15.ts index 5659ec352..297db5f3c 100644 --- a/packages/core/src/tonApiV2/models/BlockchainConfig15.ts +++ b/packages/core/src/tonApiV2/models/BlockchainConfig15.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * The reward in nanoTons for block creation in the TON blockchain. * @export @@ -49,13 +49,11 @@ export interface BlockchainConfig15 { * Check if a given object implements the BlockchainConfig15 interface. */ export function instanceOfBlockchainConfig15(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "validatorsElectedFor" in value; - isInstance = isInstance && "electionsStartBefore" in value; - isInstance = isInstance && "electionsEndBefore" in value; - isInstance = isInstance && "stakeHeldFor" in value; - - return isInstance; + if (!('validatorsElectedFor' in value)) return false; + if (!('electionsStartBefore' in value)) return false; + if (!('electionsEndBefore' in value)) return false; + if (!('stakeHeldFor' in value)) return false; + return true; } export function BlockchainConfig15FromJSON(json: any): BlockchainConfig15 { @@ -63,7 +61,7 @@ export function BlockchainConfig15FromJSON(json: any): BlockchainConfig15 { } export function BlockchainConfig15FromJSONTyped(json: any, ignoreDiscriminator: boolean): BlockchainConfig15 { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -76,18 +74,15 @@ export function BlockchainConfig15FromJSONTyped(json: any, ignoreDiscriminator: } export function BlockchainConfig15ToJSON(value?: BlockchainConfig15 | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'validators_elected_for': value.validatorsElectedFor, - 'elections_start_before': value.electionsStartBefore, - 'elections_end_before': value.electionsEndBefore, - 'stake_held_for': value.stakeHeldFor, + 'validators_elected_for': value['validatorsElectedFor'], + 'elections_start_before': value['electionsStartBefore'], + 'elections_end_before': value['electionsEndBefore'], + 'stake_held_for': value['stakeHeldFor'], }; } diff --git a/packages/core/src/tonApiV2/models/BlockchainConfig16.ts b/packages/core/src/tonApiV2/models/BlockchainConfig16.ts index 36e75a722..278ea3ab0 100644 --- a/packages/core/src/tonApiV2/models/BlockchainConfig16.ts +++ b/packages/core/src/tonApiV2/models/BlockchainConfig16.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * The limits on the number of validators in the TON blockchain. * @export @@ -43,12 +43,10 @@ export interface BlockchainConfig16 { * Check if a given object implements the BlockchainConfig16 interface. */ export function instanceOfBlockchainConfig16(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "maxValidators" in value; - isInstance = isInstance && "maxMainValidators" in value; - isInstance = isInstance && "minValidators" in value; - - return isInstance; + if (!('maxValidators' in value)) return false; + if (!('maxMainValidators' in value)) return false; + if (!('minValidators' in value)) return false; + return true; } export function BlockchainConfig16FromJSON(json: any): BlockchainConfig16 { @@ -56,7 +54,7 @@ export function BlockchainConfig16FromJSON(json: any): BlockchainConfig16 { } export function BlockchainConfig16FromJSONTyped(json: any, ignoreDiscriminator: boolean): BlockchainConfig16 { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -68,17 +66,14 @@ export function BlockchainConfig16FromJSONTyped(json: any, ignoreDiscriminator: } export function BlockchainConfig16ToJSON(value?: BlockchainConfig16 | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'max_validators': value.maxValidators, - 'max_main_validators': value.maxMainValidators, - 'min_validators': value.minValidators, + 'max_validators': value['maxValidators'], + 'max_main_validators': value['maxMainValidators'], + 'min_validators': value['minValidators'], }; } diff --git a/packages/core/src/tonApiV2/models/BlockchainConfig17.ts b/packages/core/src/tonApiV2/models/BlockchainConfig17.ts index 7e429a5e0..1a4ff6fa6 100644 --- a/packages/core/src/tonApiV2/models/BlockchainConfig17.ts +++ b/packages/core/src/tonApiV2/models/BlockchainConfig17.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * The stake parameters configuration in the TON blockchain. * @export @@ -49,13 +49,11 @@ export interface BlockchainConfig17 { * Check if a given object implements the BlockchainConfig17 interface. */ export function instanceOfBlockchainConfig17(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "minStake" in value; - isInstance = isInstance && "maxStake" in value; - isInstance = isInstance && "minTotalStake" in value; - isInstance = isInstance && "maxStakeFactor" in value; - - return isInstance; + if (!('minStake' in value)) return false; + if (!('maxStake' in value)) return false; + if (!('minTotalStake' in value)) return false; + if (!('maxStakeFactor' in value)) return false; + return true; } export function BlockchainConfig17FromJSON(json: any): BlockchainConfig17 { @@ -63,7 +61,7 @@ export function BlockchainConfig17FromJSON(json: any): BlockchainConfig17 { } export function BlockchainConfig17FromJSONTyped(json: any, ignoreDiscriminator: boolean): BlockchainConfig17 { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -76,18 +74,15 @@ export function BlockchainConfig17FromJSONTyped(json: any, ignoreDiscriminator: } export function BlockchainConfig17ToJSON(value?: BlockchainConfig17 | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'min_stake': value.minStake, - 'max_stake': value.maxStake, - 'min_total_stake': value.minTotalStake, - 'max_stake_factor': value.maxStakeFactor, + 'min_stake': value['minStake'], + 'max_stake': value['maxStake'], + 'min_total_stake': value['minTotalStake'], + 'max_stake_factor': value['maxStakeFactor'], }; } diff --git a/packages/core/src/tonApiV2/models/BlockchainConfig18.ts b/packages/core/src/tonApiV2/models/BlockchainConfig18.ts index ff9e928f6..1c3de74d5 100644 --- a/packages/core/src/tonApiV2/models/BlockchainConfig18.ts +++ b/packages/core/src/tonApiV2/models/BlockchainConfig18.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { BlockchainConfig18StoragePricesInner } from './BlockchainConfig18StoragePricesInner'; import { BlockchainConfig18StoragePricesInnerFromJSON, @@ -38,10 +38,8 @@ export interface BlockchainConfig18 { * Check if a given object implements the BlockchainConfig18 interface. */ export function instanceOfBlockchainConfig18(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "storagePrices" in value; - - return isInstance; + if (!('storagePrices' in value)) return false; + return true; } export function BlockchainConfig18FromJSON(json: any): BlockchainConfig18 { @@ -49,7 +47,7 @@ export function BlockchainConfig18FromJSON(json: any): BlockchainConfig18 { } export function BlockchainConfig18FromJSONTyped(json: any, ignoreDiscriminator: boolean): BlockchainConfig18 { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -59,15 +57,12 @@ export function BlockchainConfig18FromJSONTyped(json: any, ignoreDiscriminator: } export function BlockchainConfig18ToJSON(value?: BlockchainConfig18 | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'storage_prices': ((value.storagePrices as Array).map(BlockchainConfig18StoragePricesInnerToJSON)), + 'storage_prices': ((value['storagePrices'] as Array).map(BlockchainConfig18StoragePricesInnerToJSON)), }; } diff --git a/packages/core/src/tonApiV2/models/BlockchainConfig18StoragePricesInner.ts b/packages/core/src/tonApiV2/models/BlockchainConfig18StoragePricesInner.ts index 52e671856..25dc254a2 100644 --- a/packages/core/src/tonApiV2/models/BlockchainConfig18StoragePricesInner.ts +++ b/packages/core/src/tonApiV2/models/BlockchainConfig18StoragePricesInner.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -55,14 +55,12 @@ export interface BlockchainConfig18StoragePricesInner { * Check if a given object implements the BlockchainConfig18StoragePricesInner interface. */ export function instanceOfBlockchainConfig18StoragePricesInner(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "utimeSince" in value; - isInstance = isInstance && "bitPricePs" in value; - isInstance = isInstance && "cellPricePs" in value; - isInstance = isInstance && "mcBitPricePs" in value; - isInstance = isInstance && "mcCellPricePs" in value; - - return isInstance; + if (!('utimeSince' in value)) return false; + if (!('bitPricePs' in value)) return false; + if (!('cellPricePs' in value)) return false; + if (!('mcBitPricePs' in value)) return false; + if (!('mcCellPricePs' in value)) return false; + return true; } export function BlockchainConfig18StoragePricesInnerFromJSON(json: any): BlockchainConfig18StoragePricesInner { @@ -70,7 +68,7 @@ export function BlockchainConfig18StoragePricesInnerFromJSON(json: any): Blockch } export function BlockchainConfig18StoragePricesInnerFromJSONTyped(json: any, ignoreDiscriminator: boolean): BlockchainConfig18StoragePricesInner { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -84,19 +82,16 @@ export function BlockchainConfig18StoragePricesInnerFromJSONTyped(json: any, ign } export function BlockchainConfig18StoragePricesInnerToJSON(value?: BlockchainConfig18StoragePricesInner | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'utime_since': value.utimeSince, - 'bit_price_ps': value.bitPricePs, - 'cell_price_ps': value.cellPricePs, - 'mc_bit_price_ps': value.mcBitPricePs, - 'mc_cell_price_ps': value.mcCellPricePs, + 'utime_since': value['utimeSince'], + 'bit_price_ps': value['bitPricePs'], + 'cell_price_ps': value['cellPricePs'], + 'mc_bit_price_ps': value['mcBitPricePs'], + 'mc_cell_price_ps': value['mcCellPricePs'], }; } diff --git a/packages/core/src/tonApiV2/models/BlockchainConfig20.ts b/packages/core/src/tonApiV2/models/BlockchainConfig20.ts index 25e6901dd..5c3a63a57 100644 --- a/packages/core/src/tonApiV2/models/BlockchainConfig20.ts +++ b/packages/core/src/tonApiV2/models/BlockchainConfig20.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { GasLimitPrices } from './GasLimitPrices'; import { GasLimitPricesFromJSON, @@ -38,10 +38,8 @@ export interface BlockchainConfig20 { * Check if a given object implements the BlockchainConfig20 interface. */ export function instanceOfBlockchainConfig20(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "gasLimitsPrices" in value; - - return isInstance; + if (!('gasLimitsPrices' in value)) return false; + return true; } export function BlockchainConfig20FromJSON(json: any): BlockchainConfig20 { @@ -49,7 +47,7 @@ export function BlockchainConfig20FromJSON(json: any): BlockchainConfig20 { } export function BlockchainConfig20FromJSONTyped(json: any, ignoreDiscriminator: boolean): BlockchainConfig20 { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -59,15 +57,12 @@ export function BlockchainConfig20FromJSONTyped(json: any, ignoreDiscriminator: } export function BlockchainConfig20ToJSON(value?: BlockchainConfig20 | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'gas_limits_prices': GasLimitPricesToJSON(value.gasLimitsPrices), + 'gas_limits_prices': GasLimitPricesToJSON(value['gasLimitsPrices']), }; } diff --git a/packages/core/src/tonApiV2/models/BlockchainConfig21.ts b/packages/core/src/tonApiV2/models/BlockchainConfig21.ts index 38c8a7be3..f071aeb13 100644 --- a/packages/core/src/tonApiV2/models/BlockchainConfig21.ts +++ b/packages/core/src/tonApiV2/models/BlockchainConfig21.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { GasLimitPrices } from './GasLimitPrices'; import { GasLimitPricesFromJSON, @@ -38,10 +38,8 @@ export interface BlockchainConfig21 { * Check if a given object implements the BlockchainConfig21 interface. */ export function instanceOfBlockchainConfig21(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "gasLimitsPrices" in value; - - return isInstance; + if (!('gasLimitsPrices' in value)) return false; + return true; } export function BlockchainConfig21FromJSON(json: any): BlockchainConfig21 { @@ -49,7 +47,7 @@ export function BlockchainConfig21FromJSON(json: any): BlockchainConfig21 { } export function BlockchainConfig21FromJSONTyped(json: any, ignoreDiscriminator: boolean): BlockchainConfig21 { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -59,15 +57,12 @@ export function BlockchainConfig21FromJSONTyped(json: any, ignoreDiscriminator: } export function BlockchainConfig21ToJSON(value?: BlockchainConfig21 | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'gas_limits_prices': GasLimitPricesToJSON(value.gasLimitsPrices), + 'gas_limits_prices': GasLimitPricesToJSON(value['gasLimitsPrices']), }; } diff --git a/packages/core/src/tonApiV2/models/BlockchainConfig22.ts b/packages/core/src/tonApiV2/models/BlockchainConfig22.ts index 978cbc5cc..b24ac430e 100644 --- a/packages/core/src/tonApiV2/models/BlockchainConfig22.ts +++ b/packages/core/src/tonApiV2/models/BlockchainConfig22.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { BlockLimits } from './BlockLimits'; import { BlockLimitsFromJSON, @@ -38,10 +38,8 @@ export interface BlockchainConfig22 { * Check if a given object implements the BlockchainConfig22 interface. */ export function instanceOfBlockchainConfig22(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "blockLimits" in value; - - return isInstance; + if (!('blockLimits' in value)) return false; + return true; } export function BlockchainConfig22FromJSON(json: any): BlockchainConfig22 { @@ -49,7 +47,7 @@ export function BlockchainConfig22FromJSON(json: any): BlockchainConfig22 { } export function BlockchainConfig22FromJSONTyped(json: any, ignoreDiscriminator: boolean): BlockchainConfig22 { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -59,15 +57,12 @@ export function BlockchainConfig22FromJSONTyped(json: any, ignoreDiscriminator: } export function BlockchainConfig22ToJSON(value?: BlockchainConfig22 | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'block_limits': BlockLimitsToJSON(value.blockLimits), + 'block_limits': BlockLimitsToJSON(value['blockLimits']), }; } diff --git a/packages/core/src/tonApiV2/models/BlockchainConfig23.ts b/packages/core/src/tonApiV2/models/BlockchainConfig23.ts index 6e70fbcf3..f9076a6b8 100644 --- a/packages/core/src/tonApiV2/models/BlockchainConfig23.ts +++ b/packages/core/src/tonApiV2/models/BlockchainConfig23.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { BlockLimits } from './BlockLimits'; import { BlockLimitsFromJSON, @@ -38,10 +38,8 @@ export interface BlockchainConfig23 { * Check if a given object implements the BlockchainConfig23 interface. */ export function instanceOfBlockchainConfig23(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "blockLimits" in value; - - return isInstance; + if (!('blockLimits' in value)) return false; + return true; } export function BlockchainConfig23FromJSON(json: any): BlockchainConfig23 { @@ -49,7 +47,7 @@ export function BlockchainConfig23FromJSON(json: any): BlockchainConfig23 { } export function BlockchainConfig23FromJSONTyped(json: any, ignoreDiscriminator: boolean): BlockchainConfig23 { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -59,15 +57,12 @@ export function BlockchainConfig23FromJSONTyped(json: any, ignoreDiscriminator: } export function BlockchainConfig23ToJSON(value?: BlockchainConfig23 | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'block_limits': BlockLimitsToJSON(value.blockLimits), + 'block_limits': BlockLimitsToJSON(value['blockLimits']), }; } diff --git a/packages/core/src/tonApiV2/models/BlockchainConfig24.ts b/packages/core/src/tonApiV2/models/BlockchainConfig24.ts index c6dc7c34e..59b12a418 100644 --- a/packages/core/src/tonApiV2/models/BlockchainConfig24.ts +++ b/packages/core/src/tonApiV2/models/BlockchainConfig24.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { MsgForwardPrices } from './MsgForwardPrices'; import { MsgForwardPricesFromJSON, @@ -38,10 +38,8 @@ export interface BlockchainConfig24 { * Check if a given object implements the BlockchainConfig24 interface. */ export function instanceOfBlockchainConfig24(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "msgForwardPrices" in value; - - return isInstance; + if (!('msgForwardPrices' in value)) return false; + return true; } export function BlockchainConfig24FromJSON(json: any): BlockchainConfig24 { @@ -49,7 +47,7 @@ export function BlockchainConfig24FromJSON(json: any): BlockchainConfig24 { } export function BlockchainConfig24FromJSONTyped(json: any, ignoreDiscriminator: boolean): BlockchainConfig24 { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -59,15 +57,12 @@ export function BlockchainConfig24FromJSONTyped(json: any, ignoreDiscriminator: } export function BlockchainConfig24ToJSON(value?: BlockchainConfig24 | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'msg_forward_prices': MsgForwardPricesToJSON(value.msgForwardPrices), + 'msg_forward_prices': MsgForwardPricesToJSON(value['msgForwardPrices']), }; } diff --git a/packages/core/src/tonApiV2/models/BlockchainConfig25.ts b/packages/core/src/tonApiV2/models/BlockchainConfig25.ts index 1cb81b783..50c6776bf 100644 --- a/packages/core/src/tonApiV2/models/BlockchainConfig25.ts +++ b/packages/core/src/tonApiV2/models/BlockchainConfig25.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { MsgForwardPrices } from './MsgForwardPrices'; import { MsgForwardPricesFromJSON, @@ -38,10 +38,8 @@ export interface BlockchainConfig25 { * Check if a given object implements the BlockchainConfig25 interface. */ export function instanceOfBlockchainConfig25(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "msgForwardPrices" in value; - - return isInstance; + if (!('msgForwardPrices' in value)) return false; + return true; } export function BlockchainConfig25FromJSON(json: any): BlockchainConfig25 { @@ -49,7 +47,7 @@ export function BlockchainConfig25FromJSON(json: any): BlockchainConfig25 { } export function BlockchainConfig25FromJSONTyped(json: any, ignoreDiscriminator: boolean): BlockchainConfig25 { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -59,15 +57,12 @@ export function BlockchainConfig25FromJSONTyped(json: any, ignoreDiscriminator: } export function BlockchainConfig25ToJSON(value?: BlockchainConfig25 | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'msg_forward_prices': MsgForwardPricesToJSON(value.msgForwardPrices), + 'msg_forward_prices': MsgForwardPricesToJSON(value['msgForwardPrices']), }; } diff --git a/packages/core/src/tonApiV2/models/BlockchainConfig28.ts b/packages/core/src/tonApiV2/models/BlockchainConfig28.ts index 09aa52309..3be924a7f 100644 --- a/packages/core/src/tonApiV2/models/BlockchainConfig28.ts +++ b/packages/core/src/tonApiV2/models/BlockchainConfig28.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * The configuration for the Catchain protocol. * @export @@ -61,13 +61,11 @@ export interface BlockchainConfig28 { * Check if a given object implements the BlockchainConfig28 interface. */ export function instanceOfBlockchainConfig28(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "mcCatchainLifetime" in value; - isInstance = isInstance && "shardCatchainLifetime" in value; - isInstance = isInstance && "shardValidatorsLifetime" in value; - isInstance = isInstance && "shardValidatorsNum" in value; - - return isInstance; + if (!('mcCatchainLifetime' in value)) return false; + if (!('shardCatchainLifetime' in value)) return false; + if (!('shardValidatorsLifetime' in value)) return false; + if (!('shardValidatorsNum' in value)) return false; + return true; } export function BlockchainConfig28FromJSON(json: any): BlockchainConfig28 { @@ -75,7 +73,7 @@ export function BlockchainConfig28FromJSON(json: any): BlockchainConfig28 { } export function BlockchainConfig28FromJSONTyped(json: any, ignoreDiscriminator: boolean): BlockchainConfig28 { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -84,26 +82,23 @@ export function BlockchainConfig28FromJSONTyped(json: any, ignoreDiscriminator: 'shardCatchainLifetime': json['shard_catchain_lifetime'], 'shardValidatorsLifetime': json['shard_validators_lifetime'], 'shardValidatorsNum': json['shard_validators_num'], - 'flags': !exists(json, 'flags') ? undefined : json['flags'], - 'shuffleMcValidators': !exists(json, 'shuffle_mc_validators') ? undefined : json['shuffle_mc_validators'], + 'flags': json['flags'] == null ? undefined : json['flags'], + 'shuffleMcValidators': json['shuffle_mc_validators'] == null ? undefined : json['shuffle_mc_validators'], }; } export function BlockchainConfig28ToJSON(value?: BlockchainConfig28 | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'mc_catchain_lifetime': value.mcCatchainLifetime, - 'shard_catchain_lifetime': value.shardCatchainLifetime, - 'shard_validators_lifetime': value.shardValidatorsLifetime, - 'shard_validators_num': value.shardValidatorsNum, - 'flags': value.flags, - 'shuffle_mc_validators': value.shuffleMcValidators, + 'mc_catchain_lifetime': value['mcCatchainLifetime'], + 'shard_catchain_lifetime': value['shardCatchainLifetime'], + 'shard_validators_lifetime': value['shardValidatorsLifetime'], + 'shard_validators_num': value['shardValidatorsNum'], + 'flags': value['flags'], + 'shuffle_mc_validators': value['shuffleMcValidators'], }; } diff --git a/packages/core/src/tonApiV2/models/BlockchainConfig29.ts b/packages/core/src/tonApiV2/models/BlockchainConfig29.ts index 47323137e..b1c56ec76 100644 --- a/packages/core/src/tonApiV2/models/BlockchainConfig29.ts +++ b/packages/core/src/tonApiV2/models/BlockchainConfig29.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * The configuration for the consensus protocol above catchain. * @export @@ -97,17 +97,15 @@ export interface BlockchainConfig29 { * Check if a given object implements the BlockchainConfig29 interface. */ export function instanceOfBlockchainConfig29(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "roundCandidates" in value; - isInstance = isInstance && "nextCandidateDelayMs" in value; - isInstance = isInstance && "consensusTimeoutMs" in value; - isInstance = isInstance && "fastAttempts" in value; - isInstance = isInstance && "attemptDuration" in value; - isInstance = isInstance && "catchainMaxDeps" in value; - isInstance = isInstance && "maxBlockBytes" in value; - isInstance = isInstance && "maxCollatedBytes" in value; - - return isInstance; + if (!('roundCandidates' in value)) return false; + if (!('nextCandidateDelayMs' in value)) return false; + if (!('consensusTimeoutMs' in value)) return false; + if (!('fastAttempts' in value)) return false; + if (!('attemptDuration' in value)) return false; + if (!('catchainMaxDeps' in value)) return false; + if (!('maxBlockBytes' in value)) return false; + if (!('maxCollatedBytes' in value)) return false; + return true; } export function BlockchainConfig29FromJSON(json: any): BlockchainConfig29 { @@ -115,13 +113,13 @@ export function BlockchainConfig29FromJSON(json: any): BlockchainConfig29 { } export function BlockchainConfig29FromJSONTyped(json: any, ignoreDiscriminator: boolean): BlockchainConfig29 { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { - 'flags': !exists(json, 'flags') ? undefined : json['flags'], - 'newCatchainIds': !exists(json, 'new_catchain_ids') ? undefined : json['new_catchain_ids'], + 'flags': json['flags'] == null ? undefined : json['flags'], + 'newCatchainIds': json['new_catchain_ids'] == null ? undefined : json['new_catchain_ids'], 'roundCandidates': json['round_candidates'], 'nextCandidateDelayMs': json['next_candidate_delay_ms'], 'consensusTimeoutMs': json['consensus_timeout_ms'], @@ -130,32 +128,29 @@ export function BlockchainConfig29FromJSONTyped(json: any, ignoreDiscriminator: 'catchainMaxDeps': json['catchain_max_deps'], 'maxBlockBytes': json['max_block_bytes'], 'maxCollatedBytes': json['max_collated_bytes'], - 'protoVersion': !exists(json, 'proto_version') ? undefined : json['proto_version'], - 'catchainMaxBlocksCoeff': !exists(json, 'catchain_max_blocks_coeff') ? undefined : json['catchain_max_blocks_coeff'], + 'protoVersion': json['proto_version'] == null ? undefined : json['proto_version'], + 'catchainMaxBlocksCoeff': json['catchain_max_blocks_coeff'] == null ? undefined : json['catchain_max_blocks_coeff'], }; } export function BlockchainConfig29ToJSON(value?: BlockchainConfig29 | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'flags': value.flags, - 'new_catchain_ids': value.newCatchainIds, - 'round_candidates': value.roundCandidates, - 'next_candidate_delay_ms': value.nextCandidateDelayMs, - 'consensus_timeout_ms': value.consensusTimeoutMs, - 'fast_attempts': value.fastAttempts, - 'attempt_duration': value.attemptDuration, - 'catchain_max_deps': value.catchainMaxDeps, - 'max_block_bytes': value.maxBlockBytes, - 'max_collated_bytes': value.maxCollatedBytes, - 'proto_version': value.protoVersion, - 'catchain_max_blocks_coeff': value.catchainMaxBlocksCoeff, + 'flags': value['flags'], + 'new_catchain_ids': value['newCatchainIds'], + 'round_candidates': value['roundCandidates'], + 'next_candidate_delay_ms': value['nextCandidateDelayMs'], + 'consensus_timeout_ms': value['consensusTimeoutMs'], + 'fast_attempts': value['fastAttempts'], + 'attempt_duration': value['attemptDuration'], + 'catchain_max_deps': value['catchainMaxDeps'], + 'max_block_bytes': value['maxBlockBytes'], + 'max_collated_bytes': value['maxCollatedBytes'], + 'proto_version': value['protoVersion'], + 'catchain_max_blocks_coeff': value['catchainMaxBlocksCoeff'], }; } diff --git a/packages/core/src/tonApiV2/models/BlockchainConfig31.ts b/packages/core/src/tonApiV2/models/BlockchainConfig31.ts index be3e6429b..e3d2e01ec 100644 --- a/packages/core/src/tonApiV2/models/BlockchainConfig31.ts +++ b/packages/core/src/tonApiV2/models/BlockchainConfig31.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * The configuration for the consensus protocol above catchain. * @export @@ -31,10 +31,8 @@ export interface BlockchainConfig31 { * Check if a given object implements the BlockchainConfig31 interface. */ export function instanceOfBlockchainConfig31(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "fundamentalSmcAddr" in value; - - return isInstance; + if (!('fundamentalSmcAddr' in value)) return false; + return true; } export function BlockchainConfig31FromJSON(json: any): BlockchainConfig31 { @@ -42,7 +40,7 @@ export function BlockchainConfig31FromJSON(json: any): BlockchainConfig31 { } export function BlockchainConfig31FromJSONTyped(json: any, ignoreDiscriminator: boolean): BlockchainConfig31 { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -52,15 +50,12 @@ export function BlockchainConfig31FromJSONTyped(json: any, ignoreDiscriminator: } export function BlockchainConfig31ToJSON(value?: BlockchainConfig31 | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'fundamental_smc_addr': value.fundamentalSmcAddr, + 'fundamental_smc_addr': value['fundamentalSmcAddr'], }; } diff --git a/packages/core/src/tonApiV2/models/BlockchainConfig40.ts b/packages/core/src/tonApiV2/models/BlockchainConfig40.ts index 23ea66b49..564df9055 100644 --- a/packages/core/src/tonApiV2/models/BlockchainConfig40.ts +++ b/packages/core/src/tonApiV2/models/BlockchainConfig40.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { MisbehaviourPunishmentConfig } from './MisbehaviourPunishmentConfig'; import { MisbehaviourPunishmentConfigFromJSON, @@ -38,10 +38,8 @@ export interface BlockchainConfig40 { * Check if a given object implements the BlockchainConfig40 interface. */ export function instanceOfBlockchainConfig40(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "misbehaviourPunishmentConfig" in value; - - return isInstance; + if (!('misbehaviourPunishmentConfig' in value)) return false; + return true; } export function BlockchainConfig40FromJSON(json: any): BlockchainConfig40 { @@ -49,7 +47,7 @@ export function BlockchainConfig40FromJSON(json: any): BlockchainConfig40 { } export function BlockchainConfig40FromJSONTyped(json: any, ignoreDiscriminator: boolean): BlockchainConfig40 { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -59,15 +57,12 @@ export function BlockchainConfig40FromJSONTyped(json: any, ignoreDiscriminator: } export function BlockchainConfig40ToJSON(value?: BlockchainConfig40 | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'misbehaviour_punishment_config': MisbehaviourPunishmentConfigToJSON(value.misbehaviourPunishmentConfig), + 'misbehaviour_punishment_config': MisbehaviourPunishmentConfigToJSON(value['misbehaviourPunishmentConfig']), }; } diff --git a/packages/core/src/tonApiV2/models/BlockchainConfig43.ts b/packages/core/src/tonApiV2/models/BlockchainConfig43.ts index d94f190ca..acce525d0 100644 --- a/packages/core/src/tonApiV2/models/BlockchainConfig43.ts +++ b/packages/core/src/tonApiV2/models/BlockchainConfig43.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { SizeLimitsConfig } from './SizeLimitsConfig'; import { SizeLimitsConfigFromJSON, @@ -38,10 +38,8 @@ export interface BlockchainConfig43 { * Check if a given object implements the BlockchainConfig43 interface. */ export function instanceOfBlockchainConfig43(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "sizeLimitsConfig" in value; - - return isInstance; + if (!('sizeLimitsConfig' in value)) return false; + return true; } export function BlockchainConfig43FromJSON(json: any): BlockchainConfig43 { @@ -49,7 +47,7 @@ export function BlockchainConfig43FromJSON(json: any): BlockchainConfig43 { } export function BlockchainConfig43FromJSONTyped(json: any, ignoreDiscriminator: boolean): BlockchainConfig43 { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -59,15 +57,12 @@ export function BlockchainConfig43FromJSONTyped(json: any, ignoreDiscriminator: } export function BlockchainConfig43ToJSON(value?: BlockchainConfig43 | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'size_limits_config': SizeLimitsConfigToJSON(value.sizeLimitsConfig), + 'size_limits_config': SizeLimitsConfigToJSON(value['sizeLimitsConfig']), }; } diff --git a/packages/core/src/tonApiV2/models/BlockchainConfig44.ts b/packages/core/src/tonApiV2/models/BlockchainConfig44.ts index bcea020f4..ffdbd7db1 100644 --- a/packages/core/src/tonApiV2/models/BlockchainConfig44.ts +++ b/packages/core/src/tonApiV2/models/BlockchainConfig44.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * suspended accounts * @export @@ -37,11 +37,9 @@ export interface BlockchainConfig44 { * Check if a given object implements the BlockchainConfig44 interface. */ export function instanceOfBlockchainConfig44(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "accounts" in value; - isInstance = isInstance && "suspendedUntil" in value; - - return isInstance; + if (!('accounts' in value)) return false; + if (!('suspendedUntil' in value)) return false; + return true; } export function BlockchainConfig44FromJSON(json: any): BlockchainConfig44 { @@ -49,7 +47,7 @@ export function BlockchainConfig44FromJSON(json: any): BlockchainConfig44 { } export function BlockchainConfig44FromJSONTyped(json: any, ignoreDiscriminator: boolean): BlockchainConfig44 { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -60,16 +58,13 @@ export function BlockchainConfig44FromJSONTyped(json: any, ignoreDiscriminator: } export function BlockchainConfig44ToJSON(value?: BlockchainConfig44 | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'accounts': value.accounts, - 'suspended_until': value.suspendedUntil, + 'accounts': value['accounts'], + 'suspended_until': value['suspendedUntil'], }; } diff --git a/packages/core/src/tonApiV2/models/BlockchainConfig5.ts b/packages/core/src/tonApiV2/models/BlockchainConfig5.ts index 484797216..5cc7de2ce 100644 --- a/packages/core/src/tonApiV2/models/BlockchainConfig5.ts +++ b/packages/core/src/tonApiV2/models/BlockchainConfig5.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -43,11 +43,9 @@ export interface BlockchainConfig5 { * Check if a given object implements the BlockchainConfig5 interface. */ export function instanceOfBlockchainConfig5(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "feeBurnNom" in value; - isInstance = isInstance && "feeBurnDenom" in value; - - return isInstance; + if (!('feeBurnNom' in value)) return false; + if (!('feeBurnDenom' in value)) return false; + return true; } export function BlockchainConfig5FromJSON(json: any): BlockchainConfig5 { @@ -55,29 +53,26 @@ export function BlockchainConfig5FromJSON(json: any): BlockchainConfig5 { } export function BlockchainConfig5FromJSONTyped(json: any, ignoreDiscriminator: boolean): BlockchainConfig5 { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { - 'blackholeAddr': !exists(json, 'blackhole_addr') ? undefined : json['blackhole_addr'], + 'blackholeAddr': json['blackhole_addr'] == null ? undefined : json['blackhole_addr'], 'feeBurnNom': json['fee_burn_nom'], 'feeBurnDenom': json['fee_burn_denom'], }; } export function BlockchainConfig5ToJSON(value?: BlockchainConfig5 | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'blackhole_addr': value.blackholeAddr, - 'fee_burn_nom': value.feeBurnNom, - 'fee_burn_denom': value.feeBurnDenom, + 'blackhole_addr': value['blackholeAddr'], + 'fee_burn_nom': value['feeBurnNom'], + 'fee_burn_denom': value['feeBurnDenom'], }; } diff --git a/packages/core/src/tonApiV2/models/BlockchainConfig6.ts b/packages/core/src/tonApiV2/models/BlockchainConfig6.ts index 8dd959af0..f1e49a63b 100644 --- a/packages/core/src/tonApiV2/models/BlockchainConfig6.ts +++ b/packages/core/src/tonApiV2/models/BlockchainConfig6.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * Minting fees of new currencies. * @export @@ -37,11 +37,9 @@ export interface BlockchainConfig6 { * Check if a given object implements the BlockchainConfig6 interface. */ export function instanceOfBlockchainConfig6(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "mintNewPrice" in value; - isInstance = isInstance && "mintAddPrice" in value; - - return isInstance; + if (!('mintNewPrice' in value)) return false; + if (!('mintAddPrice' in value)) return false; + return true; } export function BlockchainConfig6FromJSON(json: any): BlockchainConfig6 { @@ -49,7 +47,7 @@ export function BlockchainConfig6FromJSON(json: any): BlockchainConfig6 { } export function BlockchainConfig6FromJSONTyped(json: any, ignoreDiscriminator: boolean): BlockchainConfig6 { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -60,16 +58,13 @@ export function BlockchainConfig6FromJSONTyped(json: any, ignoreDiscriminator: b } export function BlockchainConfig6ToJSON(value?: BlockchainConfig6 | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'mint_new_price': value.mintNewPrice, - 'mint_add_price': value.mintAddPrice, + 'mint_new_price': value['mintNewPrice'], + 'mint_add_price': value['mintAddPrice'], }; } diff --git a/packages/core/src/tonApiV2/models/BlockchainConfig7.ts b/packages/core/src/tonApiV2/models/BlockchainConfig7.ts index 35a0ec7a4..94885c18a 100644 --- a/packages/core/src/tonApiV2/models/BlockchainConfig7.ts +++ b/packages/core/src/tonApiV2/models/BlockchainConfig7.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { BlockchainConfig7CurrenciesInner } from './BlockchainConfig7CurrenciesInner'; import { BlockchainConfig7CurrenciesInnerFromJSON, @@ -38,10 +38,8 @@ export interface BlockchainConfig7 { * Check if a given object implements the BlockchainConfig7 interface. */ export function instanceOfBlockchainConfig7(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "currencies" in value; - - return isInstance; + if (!('currencies' in value)) return false; + return true; } export function BlockchainConfig7FromJSON(json: any): BlockchainConfig7 { @@ -49,7 +47,7 @@ export function BlockchainConfig7FromJSON(json: any): BlockchainConfig7 { } export function BlockchainConfig7FromJSONTyped(json: any, ignoreDiscriminator: boolean): BlockchainConfig7 { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -59,15 +57,12 @@ export function BlockchainConfig7FromJSONTyped(json: any, ignoreDiscriminator: b } export function BlockchainConfig7ToJSON(value?: BlockchainConfig7 | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'currencies': ((value.currencies as Array).map(BlockchainConfig7CurrenciesInnerToJSON)), + 'currencies': ((value['currencies'] as Array).map(BlockchainConfig7CurrenciesInnerToJSON)), }; } diff --git a/packages/core/src/tonApiV2/models/BlockchainConfig71.ts b/packages/core/src/tonApiV2/models/BlockchainConfig71.ts index 0838bd1af..540a9c622 100644 --- a/packages/core/src/tonApiV2/models/BlockchainConfig71.ts +++ b/packages/core/src/tonApiV2/models/BlockchainConfig71.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { OracleBridgeParams } from './OracleBridgeParams'; import { OracleBridgeParamsFromJSON, @@ -38,10 +38,8 @@ export interface BlockchainConfig71 { * Check if a given object implements the BlockchainConfig71 interface. */ export function instanceOfBlockchainConfig71(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "oracleBridgeParams" in value; - - return isInstance; + if (!('oracleBridgeParams' in value)) return false; + return true; } export function BlockchainConfig71FromJSON(json: any): BlockchainConfig71 { @@ -49,7 +47,7 @@ export function BlockchainConfig71FromJSON(json: any): BlockchainConfig71 { } export function BlockchainConfig71FromJSONTyped(json: any, ignoreDiscriminator: boolean): BlockchainConfig71 { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -59,15 +57,12 @@ export function BlockchainConfig71FromJSONTyped(json: any, ignoreDiscriminator: } export function BlockchainConfig71ToJSON(value?: BlockchainConfig71 | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'oracle_bridge_params': OracleBridgeParamsToJSON(value.oracleBridgeParams), + 'oracle_bridge_params': OracleBridgeParamsToJSON(value['oracleBridgeParams']), }; } diff --git a/packages/core/src/tonApiV2/models/BlockchainConfig79.ts b/packages/core/src/tonApiV2/models/BlockchainConfig79.ts index 88336c0a0..1b098f276 100644 --- a/packages/core/src/tonApiV2/models/BlockchainConfig79.ts +++ b/packages/core/src/tonApiV2/models/BlockchainConfig79.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { JettonBridgeParams } from './JettonBridgeParams'; import { JettonBridgeParamsFromJSON, @@ -38,10 +38,8 @@ export interface BlockchainConfig79 { * Check if a given object implements the BlockchainConfig79 interface. */ export function instanceOfBlockchainConfig79(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "jettonBridgeParams" in value; - - return isInstance; + if (!('jettonBridgeParams' in value)) return false; + return true; } export function BlockchainConfig79FromJSON(json: any): BlockchainConfig79 { @@ -49,7 +47,7 @@ export function BlockchainConfig79FromJSON(json: any): BlockchainConfig79 { } export function BlockchainConfig79FromJSONTyped(json: any, ignoreDiscriminator: boolean): BlockchainConfig79 { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -59,15 +57,12 @@ export function BlockchainConfig79FromJSONTyped(json: any, ignoreDiscriminator: } export function BlockchainConfig79ToJSON(value?: BlockchainConfig79 | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'jetton_bridge_params': JettonBridgeParamsToJSON(value.jettonBridgeParams), + 'jetton_bridge_params': JettonBridgeParamsToJSON(value['jettonBridgeParams']), }; } diff --git a/packages/core/src/tonApiV2/models/BlockchainConfig7CurrenciesInner.ts b/packages/core/src/tonApiV2/models/BlockchainConfig7CurrenciesInner.ts index 98f2679d3..8ce5843f3 100644 --- a/packages/core/src/tonApiV2/models/BlockchainConfig7CurrenciesInner.ts +++ b/packages/core/src/tonApiV2/models/BlockchainConfig7CurrenciesInner.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -37,11 +37,9 @@ export interface BlockchainConfig7CurrenciesInner { * Check if a given object implements the BlockchainConfig7CurrenciesInner interface. */ export function instanceOfBlockchainConfig7CurrenciesInner(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "currencyId" in value; - isInstance = isInstance && "amount" in value; - - return isInstance; + if (!('currencyId' in value)) return false; + if (!('amount' in value)) return false; + return true; } export function BlockchainConfig7CurrenciesInnerFromJSON(json: any): BlockchainConfig7CurrenciesInner { @@ -49,7 +47,7 @@ export function BlockchainConfig7CurrenciesInnerFromJSON(json: any): BlockchainC } export function BlockchainConfig7CurrenciesInnerFromJSONTyped(json: any, ignoreDiscriminator: boolean): BlockchainConfig7CurrenciesInner { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -60,16 +58,13 @@ export function BlockchainConfig7CurrenciesInnerFromJSONTyped(json: any, ignoreD } export function BlockchainConfig7CurrenciesInnerToJSON(value?: BlockchainConfig7CurrenciesInner | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'currency_id': value.currencyId, - 'amount': value.amount, + 'currency_id': value['currencyId'], + 'amount': value['amount'], }; } diff --git a/packages/core/src/tonApiV2/models/BlockchainConfig8.ts b/packages/core/src/tonApiV2/models/BlockchainConfig8.ts index ea3257e4b..86eb442b0 100644 --- a/packages/core/src/tonApiV2/models/BlockchainConfig8.ts +++ b/packages/core/src/tonApiV2/models/BlockchainConfig8.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * The network version and additional capabilities supported by the validators. * @export @@ -37,11 +37,9 @@ export interface BlockchainConfig8 { * Check if a given object implements the BlockchainConfig8 interface. */ export function instanceOfBlockchainConfig8(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "version" in value; - isInstance = isInstance && "capabilities" in value; - - return isInstance; + if (!('version' in value)) return false; + if (!('capabilities' in value)) return false; + return true; } export function BlockchainConfig8FromJSON(json: any): BlockchainConfig8 { @@ -49,7 +47,7 @@ export function BlockchainConfig8FromJSON(json: any): BlockchainConfig8 { } export function BlockchainConfig8FromJSONTyped(json: any, ignoreDiscriminator: boolean): BlockchainConfig8 { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -60,16 +58,13 @@ export function BlockchainConfig8FromJSONTyped(json: any, ignoreDiscriminator: b } export function BlockchainConfig8ToJSON(value?: BlockchainConfig8 | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'version': value.version, - 'capabilities': value.capabilities, + 'version': value['version'], + 'capabilities': value['capabilities'], }; } diff --git a/packages/core/src/tonApiV2/models/BlockchainConfig9.ts b/packages/core/src/tonApiV2/models/BlockchainConfig9.ts index da79c4dee..3b5424c3a 100644 --- a/packages/core/src/tonApiV2/models/BlockchainConfig9.ts +++ b/packages/core/src/tonApiV2/models/BlockchainConfig9.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * List of mandatory parameters of the blockchain config. * @export @@ -31,10 +31,8 @@ export interface BlockchainConfig9 { * Check if a given object implements the BlockchainConfig9 interface. */ export function instanceOfBlockchainConfig9(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "mandatoryParams" in value; - - return isInstance; + if (!('mandatoryParams' in value)) return false; + return true; } export function BlockchainConfig9FromJSON(json: any): BlockchainConfig9 { @@ -42,7 +40,7 @@ export function BlockchainConfig9FromJSON(json: any): BlockchainConfig9 { } export function BlockchainConfig9FromJSONTyped(json: any, ignoreDiscriminator: boolean): BlockchainConfig9 { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -52,15 +50,12 @@ export function BlockchainConfig9FromJSONTyped(json: any, ignoreDiscriminator: b } export function BlockchainConfig9ToJSON(value?: BlockchainConfig9 | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'mandatory_params': value.mandatoryParams, + 'mandatory_params': value['mandatoryParams'], }; } diff --git a/packages/core/src/tonApiV2/models/BlockchainRawAccount.ts b/packages/core/src/tonApiV2/models/BlockchainRawAccount.ts index 381abeaf4..e32899e49 100644 --- a/packages/core/src/tonApiV2/models/BlockchainRawAccount.ts +++ b/packages/core/src/tonApiV2/models/BlockchainRawAccount.ts @@ -12,13 +12,25 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; +import type { AccountStatus } from './AccountStatus'; +import { + AccountStatusFromJSON, + AccountStatusFromJSONTyped, + AccountStatusToJSON, +} from './AccountStatus'; import type { AccountStorageInfo } from './AccountStorageInfo'; import { AccountStorageInfoFromJSON, AccountStorageInfoFromJSONTyped, AccountStorageInfoToJSON, } from './AccountStorageInfo'; +import type { BlockchainRawAccountLibrariesInner } from './BlockchainRawAccountLibrariesInner'; +import { + BlockchainRawAccountLibrariesInnerFromJSON, + BlockchainRawAccountLibrariesInnerFromJSONTyped, + BlockchainRawAccountLibrariesInnerToJSON, +} from './BlockchainRawAccountLibrariesInner'; /** * @@ -67,27 +79,43 @@ export interface BlockchainRawAccount { * @type {string} * @memberof BlockchainRawAccount */ - status: string; + lastTransactionHash?: string; + /** + * + * @type {string} + * @memberof BlockchainRawAccount + */ + frozenHash?: string; + /** + * + * @type {AccountStatus} + * @memberof BlockchainRawAccount + */ + status: AccountStatus; /** * * @type {AccountStorageInfo} * @memberof BlockchainRawAccount */ storage: AccountStorageInfo; + /** + * + * @type {Array} + * @memberof BlockchainRawAccount + */ + libraries?: Array; } /** * Check if a given object implements the BlockchainRawAccount interface. */ export function instanceOfBlockchainRawAccount(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "address" in value; - isInstance = isInstance && "balance" in value; - isInstance = isInstance && "lastTransactionLt" in value; - isInstance = isInstance && "status" in value; - isInstance = isInstance && "storage" in value; - - return isInstance; + if (!('address' in value)) return false; + if (!('balance' in value)) return false; + if (!('lastTransactionLt' in value)) return false; + if (!('status' in value)) return false; + if (!('storage' in value)) return false; + return true; } export function BlockchainRawAccountFromJSON(json: any): BlockchainRawAccount { @@ -95,39 +123,42 @@ export function BlockchainRawAccountFromJSON(json: any): BlockchainRawAccount { } export function BlockchainRawAccountFromJSONTyped(json: any, ignoreDiscriminator: boolean): BlockchainRawAccount { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'address': json['address'], 'balance': json['balance'], - 'extraBalance': !exists(json, 'extra_balance') ? undefined : json['extra_balance'], - 'code': !exists(json, 'code') ? undefined : json['code'], - 'data': !exists(json, 'data') ? undefined : json['data'], + 'extraBalance': json['extra_balance'] == null ? undefined : json['extra_balance'], + 'code': json['code'] == null ? undefined : json['code'], + 'data': json['data'] == null ? undefined : json['data'], 'lastTransactionLt': json['last_transaction_lt'], - 'status': json['status'], + 'lastTransactionHash': json['last_transaction_hash'] == null ? undefined : json['last_transaction_hash'], + 'frozenHash': json['frozen_hash'] == null ? undefined : json['frozen_hash'], + 'status': AccountStatusFromJSON(json['status']), 'storage': AccountStorageInfoFromJSON(json['storage']), + 'libraries': json['libraries'] == null ? undefined : ((json['libraries'] as Array).map(BlockchainRawAccountLibrariesInnerFromJSON)), }; } export function BlockchainRawAccountToJSON(value?: BlockchainRawAccount | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'address': value.address, - 'balance': value.balance, - 'extra_balance': value.extraBalance, - 'code': value.code, - 'data': value.data, - 'last_transaction_lt': value.lastTransactionLt, - 'status': value.status, - 'storage': AccountStorageInfoToJSON(value.storage), + 'address': value['address'], + 'balance': value['balance'], + 'extra_balance': value['extraBalance'], + 'code': value['code'], + 'data': value['data'], + 'last_transaction_lt': value['lastTransactionLt'], + 'last_transaction_hash': value['lastTransactionHash'], + 'frozen_hash': value['frozenHash'], + 'status': AccountStatusToJSON(value['status']), + 'storage': AccountStorageInfoToJSON(value['storage']), + 'libraries': value['libraries'] == null ? undefined : ((value['libraries'] as Array).map(BlockchainRawAccountLibrariesInnerToJSON)), }; } diff --git a/packages/core/src/tonApiV2/models/BlockchainRawAccountLibrariesInner.ts b/packages/core/src/tonApiV2/models/BlockchainRawAccountLibrariesInner.ts new file mode 100644 index 000000000..42ba6b305 --- /dev/null +++ b/packages/core/src/tonApiV2/models/BlockchainRawAccountLibrariesInner.ts @@ -0,0 +1,70 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * REST api to TON blockchain explorer + * Provide access to indexed TON blockchain + * + * The version of the OpenAPI document: 2.0.0 + * Contact: support@tonkeeper.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface BlockchainRawAccountLibrariesInner + */ +export interface BlockchainRawAccountLibrariesInner { + /** + * + * @type {boolean} + * @memberof BlockchainRawAccountLibrariesInner + */ + _public: boolean; + /** + * + * @type {string} + * @memberof BlockchainRawAccountLibrariesInner + */ + root: string; +} + +/** + * Check if a given object implements the BlockchainRawAccountLibrariesInner interface. + */ +export function instanceOfBlockchainRawAccountLibrariesInner(value: object): boolean { + if (!('_public' in value)) return false; + if (!('root' in value)) return false; + return true; +} + +export function BlockchainRawAccountLibrariesInnerFromJSON(json: any): BlockchainRawAccountLibrariesInner { + return BlockchainRawAccountLibrariesInnerFromJSONTyped(json, false); +} + +export function BlockchainRawAccountLibrariesInnerFromJSONTyped(json: any, ignoreDiscriminator: boolean): BlockchainRawAccountLibrariesInner { + if (json == null) { + return json; + } + return { + + '_public': json['public'], + 'root': json['root'], + }; +} + +export function BlockchainRawAccountLibrariesInnerToJSON(value?: BlockchainRawAccountLibrariesInner | null): any { + if (value == null) { + return value; + } + return { + + 'public': value['_public'], + 'root': value['root'], + }; +} + diff --git a/packages/core/src/tonApiV2/models/ComputePhase.ts b/packages/core/src/tonApiV2/models/ComputePhase.ts index 93611b37a..1b0808137 100644 --- a/packages/core/src/tonApiV2/models/ComputePhase.ts +++ b/packages/core/src/tonApiV2/models/ComputePhase.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { ComputeSkipReason } from './ComputeSkipReason'; import { ComputeSkipReasonFromJSON, @@ -74,10 +74,8 @@ export interface ComputePhase { * Check if a given object implements the ComputePhase interface. */ export function instanceOfComputePhase(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "skipped" in value; - - return isInstance; + if (!('skipped' in value)) return false; + return true; } export function ComputePhaseFromJSON(json: any): ComputePhase { @@ -85,37 +83,34 @@ export function ComputePhaseFromJSON(json: any): ComputePhase { } export function ComputePhaseFromJSONTyped(json: any, ignoreDiscriminator: boolean): ComputePhase { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'skipped': json['skipped'], - 'skipReason': !exists(json, 'skip_reason') ? undefined : ComputeSkipReasonFromJSON(json['skip_reason']), - 'success': !exists(json, 'success') ? undefined : json['success'], - 'gasFees': !exists(json, 'gas_fees') ? undefined : json['gas_fees'], - 'gasUsed': !exists(json, 'gas_used') ? undefined : json['gas_used'], - 'vmSteps': !exists(json, 'vm_steps') ? undefined : json['vm_steps'], - 'exitCode': !exists(json, 'exit_code') ? undefined : json['exit_code'], + 'skipReason': json['skip_reason'] == null ? undefined : ComputeSkipReasonFromJSON(json['skip_reason']), + 'success': json['success'] == null ? undefined : json['success'], + 'gasFees': json['gas_fees'] == null ? undefined : json['gas_fees'], + 'gasUsed': json['gas_used'] == null ? undefined : json['gas_used'], + 'vmSteps': json['vm_steps'] == null ? undefined : json['vm_steps'], + 'exitCode': json['exit_code'] == null ? undefined : json['exit_code'], }; } export function ComputePhaseToJSON(value?: ComputePhase | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'skipped': value.skipped, - 'skip_reason': ComputeSkipReasonToJSON(value.skipReason), - 'success': value.success, - 'gas_fees': value.gasFees, - 'gas_used': value.gasUsed, - 'vm_steps': value.vmSteps, - 'exit_code': value.exitCode, + 'skipped': value['skipped'], + 'skip_reason': ComputeSkipReasonToJSON(value['skipReason']), + 'success': value['success'], + 'gas_fees': value['gasFees'], + 'gas_used': value['gasUsed'], + 'vm_steps': value['vmSteps'], + 'exit_code': value['exitCode'], }; } diff --git a/packages/core/src/tonApiV2/models/ConfigProposalSetup.ts b/packages/core/src/tonApiV2/models/ConfigProposalSetup.ts index d74ae59cd..169e55009 100644 --- a/packages/core/src/tonApiV2/models/ConfigProposalSetup.ts +++ b/packages/core/src/tonApiV2/models/ConfigProposalSetup.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -73,17 +73,15 @@ export interface ConfigProposalSetup { * Check if a given object implements the ConfigProposalSetup interface. */ export function instanceOfConfigProposalSetup(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "minTotRounds" in value; - isInstance = isInstance && "maxTotRounds" in value; - isInstance = isInstance && "minWins" in value; - isInstance = isInstance && "maxLosses" in value; - isInstance = isInstance && "minStoreSec" in value; - isInstance = isInstance && "maxStoreSec" in value; - isInstance = isInstance && "bitPrice" in value; - isInstance = isInstance && "cellPrice" in value; - - return isInstance; + if (!('minTotRounds' in value)) return false; + if (!('maxTotRounds' in value)) return false; + if (!('minWins' in value)) return false; + if (!('maxLosses' in value)) return false; + if (!('minStoreSec' in value)) return false; + if (!('maxStoreSec' in value)) return false; + if (!('bitPrice' in value)) return false; + if (!('cellPrice' in value)) return false; + return true; } export function ConfigProposalSetupFromJSON(json: any): ConfigProposalSetup { @@ -91,7 +89,7 @@ export function ConfigProposalSetupFromJSON(json: any): ConfigProposalSetup { } export function ConfigProposalSetupFromJSONTyped(json: any, ignoreDiscriminator: boolean): ConfigProposalSetup { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -108,22 +106,19 @@ export function ConfigProposalSetupFromJSONTyped(json: any, ignoreDiscriminator: } export function ConfigProposalSetupToJSON(value?: ConfigProposalSetup | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'min_tot_rounds': value.minTotRounds, - 'max_tot_rounds': value.maxTotRounds, - 'min_wins': value.minWins, - 'max_losses': value.maxLosses, - 'min_store_sec': value.minStoreSec, - 'max_store_sec': value.maxStoreSec, - 'bit_price': value.bitPrice, - 'cell_price': value.cellPrice, + 'min_tot_rounds': value['minTotRounds'], + 'max_tot_rounds': value['maxTotRounds'], + 'min_wins': value['minWins'], + 'max_losses': value['maxLosses'], + 'min_store_sec': value['minStoreSec'], + 'max_store_sec': value['maxStoreSec'], + 'bit_price': value['bitPrice'], + 'cell_price': value['cellPrice'], }; } diff --git a/packages/core/src/tonApiV2/models/ContractDeployAction.ts b/packages/core/src/tonApiV2/models/ContractDeployAction.ts index 3d97b60ce..1b95fc0b1 100644 --- a/packages/core/src/tonApiV2/models/ContractDeployAction.ts +++ b/packages/core/src/tonApiV2/models/ContractDeployAction.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -37,11 +37,9 @@ export interface ContractDeployAction { * Check if a given object implements the ContractDeployAction interface. */ export function instanceOfContractDeployAction(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "address" in value; - isInstance = isInstance && "interfaces" in value; - - return isInstance; + if (!('address' in value)) return false; + if (!('interfaces' in value)) return false; + return true; } export function ContractDeployActionFromJSON(json: any): ContractDeployAction { @@ -49,7 +47,7 @@ export function ContractDeployActionFromJSON(json: any): ContractDeployAction { } export function ContractDeployActionFromJSONTyped(json: any, ignoreDiscriminator: boolean): ContractDeployAction { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -60,16 +58,13 @@ export function ContractDeployActionFromJSONTyped(json: any, ignoreDiscriminator } export function ContractDeployActionToJSON(value?: ContractDeployAction | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'address': value.address, - 'interfaces': value.interfaces, + 'address': value['address'], + 'interfaces': value['interfaces'], }; } diff --git a/packages/core/src/tonApiV2/models/CreditPhase.ts b/packages/core/src/tonApiV2/models/CreditPhase.ts index 5d3c752e2..5fb88e34a 100644 --- a/packages/core/src/tonApiV2/models/CreditPhase.ts +++ b/packages/core/src/tonApiV2/models/CreditPhase.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -37,11 +37,9 @@ export interface CreditPhase { * Check if a given object implements the CreditPhase interface. */ export function instanceOfCreditPhase(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "feesCollected" in value; - isInstance = isInstance && "credit" in value; - - return isInstance; + if (!('feesCollected' in value)) return false; + if (!('credit' in value)) return false; + return true; } export function CreditPhaseFromJSON(json: any): CreditPhase { @@ -49,7 +47,7 @@ export function CreditPhaseFromJSON(json: any): CreditPhase { } export function CreditPhaseFromJSONTyped(json: any, ignoreDiscriminator: boolean): CreditPhase { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -60,16 +58,13 @@ export function CreditPhaseFromJSONTyped(json: any, ignoreDiscriminator: boolean } export function CreditPhaseToJSON(value?: CreditPhase | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'fees_collected': value.feesCollected, - 'credit': value.credit, + 'fees_collected': value['feesCollected'], + 'credit': value['credit'], }; } diff --git a/packages/core/src/tonApiV2/models/DecodeMessageRequest.ts b/packages/core/src/tonApiV2/models/DecodeMessageRequest.ts index ba2c0e0b3..36165f4d7 100644 --- a/packages/core/src/tonApiV2/models/DecodeMessageRequest.ts +++ b/packages/core/src/tonApiV2/models/DecodeMessageRequest.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -31,10 +31,8 @@ export interface DecodeMessageRequest { * Check if a given object implements the DecodeMessageRequest interface. */ export function instanceOfDecodeMessageRequest(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "boc" in value; - - return isInstance; + if (!('boc' in value)) return false; + return true; } export function DecodeMessageRequestFromJSON(json: any): DecodeMessageRequest { @@ -42,7 +40,7 @@ export function DecodeMessageRequestFromJSON(json: any): DecodeMessageRequest { } export function DecodeMessageRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): DecodeMessageRequest { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -52,15 +50,12 @@ export function DecodeMessageRequestFromJSONTyped(json: any, ignoreDiscriminator } export function DecodeMessageRequestToJSON(value?: DecodeMessageRequest | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'boc': value.boc, + 'boc': value['boc'], }; } diff --git a/packages/core/src/tonApiV2/models/DecodedMessage.ts b/packages/core/src/tonApiV2/models/DecodedMessage.ts index 8f9d1833d..a3cac812a 100644 --- a/packages/core/src/tonApiV2/models/DecodedMessage.ts +++ b/packages/core/src/tonApiV2/models/DecodedMessage.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { AccountAddress } from './AccountAddress'; import { AccountAddressFromJSON, @@ -56,11 +56,9 @@ export interface DecodedMessage { * Check if a given object implements the DecodedMessage interface. */ export function instanceOfDecodedMessage(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "destination" in value; - isInstance = isInstance && "destinationWalletVersion" in value; - - return isInstance; + if (!('destination' in value)) return false; + if (!('destinationWalletVersion' in value)) return false; + return true; } export function DecodedMessageFromJSON(json: any): DecodedMessage { @@ -68,29 +66,26 @@ export function DecodedMessageFromJSON(json: any): DecodedMessage { } export function DecodedMessageFromJSONTyped(json: any, ignoreDiscriminator: boolean): DecodedMessage { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'destination': AccountAddressFromJSON(json['destination']), 'destinationWalletVersion': json['destination_wallet_version'], - 'extInMsgDecoded': !exists(json, 'ext_in_msg_decoded') ? undefined : DecodedMessageExtInMsgDecodedFromJSON(json['ext_in_msg_decoded']), + 'extInMsgDecoded': json['ext_in_msg_decoded'] == null ? undefined : DecodedMessageExtInMsgDecodedFromJSON(json['ext_in_msg_decoded']), }; } export function DecodedMessageToJSON(value?: DecodedMessage | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'destination': AccountAddressToJSON(value.destination), - 'destination_wallet_version': value.destinationWalletVersion, - 'ext_in_msg_decoded': DecodedMessageExtInMsgDecodedToJSON(value.extInMsgDecoded), + 'destination': AccountAddressToJSON(value['destination']), + 'destination_wallet_version': value['destinationWalletVersion'], + 'ext_in_msg_decoded': DecodedMessageExtInMsgDecodedToJSON(value['extInMsgDecoded']), }; } diff --git a/packages/core/src/tonApiV2/models/DecodedMessageExtInMsgDecoded.ts b/packages/core/src/tonApiV2/models/DecodedMessageExtInMsgDecoded.ts index 710b0ce3e..d19b1dec8 100644 --- a/packages/core/src/tonApiV2/models/DecodedMessageExtInMsgDecoded.ts +++ b/packages/core/src/tonApiV2/models/DecodedMessageExtInMsgDecoded.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { DecodedMessageExtInMsgDecodedWalletHighloadV2 } from './DecodedMessageExtInMsgDecodedWalletHighloadV2'; import { DecodedMessageExtInMsgDecodedWalletHighloadV2FromJSON, @@ -62,9 +62,7 @@ export interface DecodedMessageExtInMsgDecoded { * Check if a given object implements the DecodedMessageExtInMsgDecoded interface. */ export function instanceOfDecodedMessageExtInMsgDecoded(value: object): boolean { - let isInstance = true; - - return isInstance; + return true; } export function DecodedMessageExtInMsgDecodedFromJSON(json: any): DecodedMessageExtInMsgDecoded { @@ -72,29 +70,26 @@ export function DecodedMessageExtInMsgDecodedFromJSON(json: any): DecodedMessage } export function DecodedMessageExtInMsgDecodedFromJSONTyped(json: any, ignoreDiscriminator: boolean): DecodedMessageExtInMsgDecoded { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { - 'walletV3': !exists(json, 'wallet_v3') ? undefined : DecodedMessageExtInMsgDecodedWalletV3FromJSON(json['wallet_v3']), - 'walletV4': !exists(json, 'wallet_v4') ? undefined : DecodedMessageExtInMsgDecodedWalletV4FromJSON(json['wallet_v4']), - 'walletHighloadV2': !exists(json, 'wallet_highload_v2') ? undefined : DecodedMessageExtInMsgDecodedWalletHighloadV2FromJSON(json['wallet_highload_v2']), + 'walletV3': json['wallet_v3'] == null ? undefined : DecodedMessageExtInMsgDecodedWalletV3FromJSON(json['wallet_v3']), + 'walletV4': json['wallet_v4'] == null ? undefined : DecodedMessageExtInMsgDecodedWalletV4FromJSON(json['wallet_v4']), + 'walletHighloadV2': json['wallet_highload_v2'] == null ? undefined : DecodedMessageExtInMsgDecodedWalletHighloadV2FromJSON(json['wallet_highload_v2']), }; } export function DecodedMessageExtInMsgDecodedToJSON(value?: DecodedMessageExtInMsgDecoded | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'wallet_v3': DecodedMessageExtInMsgDecodedWalletV3ToJSON(value.walletV3), - 'wallet_v4': DecodedMessageExtInMsgDecodedWalletV4ToJSON(value.walletV4), - 'wallet_highload_v2': DecodedMessageExtInMsgDecodedWalletHighloadV2ToJSON(value.walletHighloadV2), + 'wallet_v3': DecodedMessageExtInMsgDecodedWalletV3ToJSON(value['walletV3']), + 'wallet_v4': DecodedMessageExtInMsgDecodedWalletV4ToJSON(value['walletV4']), + 'wallet_highload_v2': DecodedMessageExtInMsgDecodedWalletHighloadV2ToJSON(value['walletHighloadV2']), }; } diff --git a/packages/core/src/tonApiV2/models/DecodedMessageExtInMsgDecodedWalletHighloadV2.ts b/packages/core/src/tonApiV2/models/DecodedMessageExtInMsgDecodedWalletHighloadV2.ts index 275267d78..dbfdb5c31 100644 --- a/packages/core/src/tonApiV2/models/DecodedMessageExtInMsgDecodedWalletHighloadV2.ts +++ b/packages/core/src/tonApiV2/models/DecodedMessageExtInMsgDecodedWalletHighloadV2.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { DecodedRawMessage } from './DecodedRawMessage'; import { DecodedRawMessageFromJSON, @@ -50,12 +50,10 @@ export interface DecodedMessageExtInMsgDecodedWalletHighloadV2 { * Check if a given object implements the DecodedMessageExtInMsgDecodedWalletHighloadV2 interface. */ export function instanceOfDecodedMessageExtInMsgDecodedWalletHighloadV2(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "subwalletId" in value; - isInstance = isInstance && "boundedQueryId" in value; - isInstance = isInstance && "rawMessages" in value; - - return isInstance; + if (!('subwalletId' in value)) return false; + if (!('boundedQueryId' in value)) return false; + if (!('rawMessages' in value)) return false; + return true; } export function DecodedMessageExtInMsgDecodedWalletHighloadV2FromJSON(json: any): DecodedMessageExtInMsgDecodedWalletHighloadV2 { @@ -63,7 +61,7 @@ export function DecodedMessageExtInMsgDecodedWalletHighloadV2FromJSON(json: any) } export function DecodedMessageExtInMsgDecodedWalletHighloadV2FromJSONTyped(json: any, ignoreDiscriminator: boolean): DecodedMessageExtInMsgDecodedWalletHighloadV2 { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -75,17 +73,14 @@ export function DecodedMessageExtInMsgDecodedWalletHighloadV2FromJSONTyped(json: } export function DecodedMessageExtInMsgDecodedWalletHighloadV2ToJSON(value?: DecodedMessageExtInMsgDecodedWalletHighloadV2 | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'subwallet_id': value.subwalletId, - 'bounded_query_id': value.boundedQueryId, - 'raw_messages': ((value.rawMessages as Array).map(DecodedRawMessageToJSON)), + 'subwallet_id': value['subwalletId'], + 'bounded_query_id': value['boundedQueryId'], + 'raw_messages': ((value['rawMessages'] as Array).map(DecodedRawMessageToJSON)), }; } diff --git a/packages/core/src/tonApiV2/models/DecodedMessageExtInMsgDecodedWalletV3.ts b/packages/core/src/tonApiV2/models/DecodedMessageExtInMsgDecodedWalletV3.ts index 8c381344a..edeb9381a 100644 --- a/packages/core/src/tonApiV2/models/DecodedMessageExtInMsgDecodedWalletV3.ts +++ b/packages/core/src/tonApiV2/models/DecodedMessageExtInMsgDecodedWalletV3.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { DecodedRawMessage } from './DecodedRawMessage'; import { DecodedRawMessageFromJSON, @@ -56,13 +56,11 @@ export interface DecodedMessageExtInMsgDecodedWalletV3 { * Check if a given object implements the DecodedMessageExtInMsgDecodedWalletV3 interface. */ export function instanceOfDecodedMessageExtInMsgDecodedWalletV3(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "subwalletId" in value; - isInstance = isInstance && "validUntil" in value; - isInstance = isInstance && "seqno" in value; - isInstance = isInstance && "rawMessages" in value; - - return isInstance; + if (!('subwalletId' in value)) return false; + if (!('validUntil' in value)) return false; + if (!('seqno' in value)) return false; + if (!('rawMessages' in value)) return false; + return true; } export function DecodedMessageExtInMsgDecodedWalletV3FromJSON(json: any): DecodedMessageExtInMsgDecodedWalletV3 { @@ -70,7 +68,7 @@ export function DecodedMessageExtInMsgDecodedWalletV3FromJSON(json: any): Decode } export function DecodedMessageExtInMsgDecodedWalletV3FromJSONTyped(json: any, ignoreDiscriminator: boolean): DecodedMessageExtInMsgDecodedWalletV3 { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -83,18 +81,15 @@ export function DecodedMessageExtInMsgDecodedWalletV3FromJSONTyped(json: any, ig } export function DecodedMessageExtInMsgDecodedWalletV3ToJSON(value?: DecodedMessageExtInMsgDecodedWalletV3 | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'subwallet_id': value.subwalletId, - 'valid_until': value.validUntil, - 'seqno': value.seqno, - 'raw_messages': ((value.rawMessages as Array).map(DecodedRawMessageToJSON)), + 'subwallet_id': value['subwalletId'], + 'valid_until': value['validUntil'], + 'seqno': value['seqno'], + 'raw_messages': ((value['rawMessages'] as Array).map(DecodedRawMessageToJSON)), }; } diff --git a/packages/core/src/tonApiV2/models/DecodedMessageExtInMsgDecodedWalletV4.ts b/packages/core/src/tonApiV2/models/DecodedMessageExtInMsgDecodedWalletV4.ts index e783cad8a..d340a3ed1 100644 --- a/packages/core/src/tonApiV2/models/DecodedMessageExtInMsgDecodedWalletV4.ts +++ b/packages/core/src/tonApiV2/models/DecodedMessageExtInMsgDecodedWalletV4.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { DecodedRawMessage } from './DecodedRawMessage'; import { DecodedRawMessageFromJSON, @@ -62,14 +62,12 @@ export interface DecodedMessageExtInMsgDecodedWalletV4 { * Check if a given object implements the DecodedMessageExtInMsgDecodedWalletV4 interface. */ export function instanceOfDecodedMessageExtInMsgDecodedWalletV4(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "subwalletId" in value; - isInstance = isInstance && "validUntil" in value; - isInstance = isInstance && "seqno" in value; - isInstance = isInstance && "op" in value; - isInstance = isInstance && "rawMessages" in value; - - return isInstance; + if (!('subwalletId' in value)) return false; + if (!('validUntil' in value)) return false; + if (!('seqno' in value)) return false; + if (!('op' in value)) return false; + if (!('rawMessages' in value)) return false; + return true; } export function DecodedMessageExtInMsgDecodedWalletV4FromJSON(json: any): DecodedMessageExtInMsgDecodedWalletV4 { @@ -77,7 +75,7 @@ export function DecodedMessageExtInMsgDecodedWalletV4FromJSON(json: any): Decode } export function DecodedMessageExtInMsgDecodedWalletV4FromJSONTyped(json: any, ignoreDiscriminator: boolean): DecodedMessageExtInMsgDecodedWalletV4 { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -91,19 +89,16 @@ export function DecodedMessageExtInMsgDecodedWalletV4FromJSONTyped(json: any, ig } export function DecodedMessageExtInMsgDecodedWalletV4ToJSON(value?: DecodedMessageExtInMsgDecodedWalletV4 | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'subwallet_id': value.subwalletId, - 'valid_until': value.validUntil, - 'seqno': value.seqno, - 'op': value.op, - 'raw_messages': ((value.rawMessages as Array).map(DecodedRawMessageToJSON)), + 'subwallet_id': value['subwalletId'], + 'valid_until': value['validUntil'], + 'seqno': value['seqno'], + 'op': value['op'], + 'raw_messages': ((value['rawMessages'] as Array).map(DecodedRawMessageToJSON)), }; } diff --git a/packages/core/src/tonApiV2/models/DecodedRawMessage.ts b/packages/core/src/tonApiV2/models/DecodedRawMessage.ts index db4350d00..473b78ba6 100644 --- a/packages/core/src/tonApiV2/models/DecodedRawMessage.ts +++ b/packages/core/src/tonApiV2/models/DecodedRawMessage.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { DecodedRawMessageMessage } from './DecodedRawMessageMessage'; import { DecodedRawMessageMessageFromJSON, @@ -44,11 +44,9 @@ export interface DecodedRawMessage { * Check if a given object implements the DecodedRawMessage interface. */ export function instanceOfDecodedRawMessage(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "message" in value; - isInstance = isInstance && "mode" in value; - - return isInstance; + if (!('message' in value)) return false; + if (!('mode' in value)) return false; + return true; } export function DecodedRawMessageFromJSON(json: any): DecodedRawMessage { @@ -56,7 +54,7 @@ export function DecodedRawMessageFromJSON(json: any): DecodedRawMessage { } export function DecodedRawMessageFromJSONTyped(json: any, ignoreDiscriminator: boolean): DecodedRawMessage { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -67,16 +65,13 @@ export function DecodedRawMessageFromJSONTyped(json: any, ignoreDiscriminator: b } export function DecodedRawMessageToJSON(value?: DecodedRawMessage | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'message': DecodedRawMessageMessageToJSON(value.message), - 'mode': value.mode, + 'message': DecodedRawMessageMessageToJSON(value['message']), + 'mode': value['mode'], }; } diff --git a/packages/core/src/tonApiV2/models/DecodedRawMessageMessage.ts b/packages/core/src/tonApiV2/models/DecodedRawMessageMessage.ts index 129787a8b..0b6a3c417 100644 --- a/packages/core/src/tonApiV2/models/DecodedRawMessageMessage.ts +++ b/packages/core/src/tonApiV2/models/DecodedRawMessageMessage.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -42,17 +42,15 @@ export interface DecodedRawMessageMessage { * @type {any} * @memberof DecodedRawMessageMessage */ - decodedBody?: any | null; + decodedBody?: any; } /** * Check if a given object implements the DecodedRawMessageMessage interface. */ export function instanceOfDecodedRawMessageMessage(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "boc" in value; - - return isInstance; + if (!('boc' in value)) return false; + return true; } export function DecodedRawMessageMessageFromJSON(json: any): DecodedRawMessageMessage { @@ -60,31 +58,28 @@ export function DecodedRawMessageMessageFromJSON(json: any): DecodedRawMessageMe } export function DecodedRawMessageMessageFromJSONTyped(json: any, ignoreDiscriminator: boolean): DecodedRawMessageMessage { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'boc': json['boc'], - 'decodedOpName': !exists(json, 'decoded_op_name') ? undefined : json['decoded_op_name'], - 'opCode': !exists(json, 'op_code') ? undefined : json['op_code'], - 'decodedBody': !exists(json, 'decoded_body') ? undefined : json['decoded_body'], + 'decodedOpName': json['decoded_op_name'] == null ? undefined : json['decoded_op_name'], + 'opCode': json['op_code'] == null ? undefined : json['op_code'], + 'decodedBody': json['decoded_body'] == null ? undefined : json['decoded_body'], }; } export function DecodedRawMessageMessageToJSON(value?: DecodedRawMessageMessage | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'boc': value.boc, - 'decoded_op_name': value.decodedOpName, - 'op_code': value.opCode, - 'decoded_body': value.decodedBody, + 'boc': value['boc'], + 'decoded_op_name': value['decodedOpName'], + 'op_code': value['opCode'], + 'decoded_body': value['decodedBody'], }; } diff --git a/packages/core/src/tonApiV2/models/DepositStakeAction.ts b/packages/core/src/tonApiV2/models/DepositStakeAction.ts index d721ed85b..9123e0919 100644 --- a/packages/core/src/tonApiV2/models/DepositStakeAction.ts +++ b/packages/core/src/tonApiV2/models/DepositStakeAction.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { AccountAddress } from './AccountAddress'; import { AccountAddressFromJSON, @@ -62,13 +62,11 @@ export interface DepositStakeAction { * Check if a given object implements the DepositStakeAction interface. */ export function instanceOfDepositStakeAction(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "amount" in value; - isInstance = isInstance && "staker" in value; - isInstance = isInstance && "pool" in value; - isInstance = isInstance && "implementation" in value; - - return isInstance; + if (!('amount' in value)) return false; + if (!('staker' in value)) return false; + if (!('pool' in value)) return false; + if (!('implementation' in value)) return false; + return true; } export function DepositStakeActionFromJSON(json: any): DepositStakeAction { @@ -76,7 +74,7 @@ export function DepositStakeActionFromJSON(json: any): DepositStakeAction { } export function DepositStakeActionFromJSONTyped(json: any, ignoreDiscriminator: boolean): DepositStakeAction { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -89,18 +87,15 @@ export function DepositStakeActionFromJSONTyped(json: any, ignoreDiscriminator: } export function DepositStakeActionToJSON(value?: DepositStakeAction | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'amount': value.amount, - 'staker': AccountAddressToJSON(value.staker), - 'pool': AccountAddressToJSON(value.pool), - 'implementation': PoolImplementationTypeToJSON(value.implementation), + 'amount': value['amount'], + 'staker': AccountAddressToJSON(value['staker']), + 'pool': AccountAddressToJSON(value['pool']), + 'implementation': PoolImplementationTypeToJSON(value['implementation']), }; } diff --git a/packages/core/src/tonApiV2/models/DnsExpiring.ts b/packages/core/src/tonApiV2/models/DnsExpiring.ts index 770e5a893..3f4fe3621 100644 --- a/packages/core/src/tonApiV2/models/DnsExpiring.ts +++ b/packages/core/src/tonApiV2/models/DnsExpiring.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { DnsExpiringItemsInner } from './DnsExpiringItemsInner'; import { DnsExpiringItemsInnerFromJSON, @@ -38,10 +38,8 @@ export interface DnsExpiring { * Check if a given object implements the DnsExpiring interface. */ export function instanceOfDnsExpiring(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "items" in value; - - return isInstance; + if (!('items' in value)) return false; + return true; } export function DnsExpiringFromJSON(json: any): DnsExpiring { @@ -49,7 +47,7 @@ export function DnsExpiringFromJSON(json: any): DnsExpiring { } export function DnsExpiringFromJSONTyped(json: any, ignoreDiscriminator: boolean): DnsExpiring { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -59,15 +57,12 @@ export function DnsExpiringFromJSONTyped(json: any, ignoreDiscriminator: boolean } export function DnsExpiringToJSON(value?: DnsExpiring | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'items': ((value.items as Array).map(DnsExpiringItemsInnerToJSON)), + 'items': ((value['items'] as Array).map(DnsExpiringItemsInnerToJSON)), }; } diff --git a/packages/core/src/tonApiV2/models/DnsExpiringItemsInner.ts b/packages/core/src/tonApiV2/models/DnsExpiringItemsInner.ts index 8ad84088c..f1a5d07a7 100644 --- a/packages/core/src/tonApiV2/models/DnsExpiringItemsInner.ts +++ b/packages/core/src/tonApiV2/models/DnsExpiringItemsInner.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { NftItem } from './NftItem'; import { NftItemFromJSON, @@ -50,11 +50,9 @@ export interface DnsExpiringItemsInner { * Check if a given object implements the DnsExpiringItemsInner interface. */ export function instanceOfDnsExpiringItemsInner(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "expiringAt" in value; - isInstance = isInstance && "name" in value; - - return isInstance; + if (!('expiringAt' in value)) return false; + if (!('name' in value)) return false; + return true; } export function DnsExpiringItemsInnerFromJSON(json: any): DnsExpiringItemsInner { @@ -62,29 +60,26 @@ export function DnsExpiringItemsInnerFromJSON(json: any): DnsExpiringItemsInner } export function DnsExpiringItemsInnerFromJSONTyped(json: any, ignoreDiscriminator: boolean): DnsExpiringItemsInner { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'expiringAt': json['expiring_at'], 'name': json['name'], - 'dnsItem': !exists(json, 'dns_item') ? undefined : NftItemFromJSON(json['dns_item']), + 'dnsItem': json['dns_item'] == null ? undefined : NftItemFromJSON(json['dns_item']), }; } export function DnsExpiringItemsInnerToJSON(value?: DnsExpiringItemsInner | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'expiring_at': value.expiringAt, - 'name': value.name, - 'dns_item': NftItemToJSON(value.dnsItem), + 'expiring_at': value['expiringAt'], + 'name': value['name'], + 'dns_item': NftItemToJSON(value['dnsItem']), }; } diff --git a/packages/core/src/tonApiV2/models/DnsRecord.ts b/packages/core/src/tonApiV2/models/DnsRecord.ts index 3199c0908..674501862 100644 --- a/packages/core/src/tonApiV2/models/DnsRecord.ts +++ b/packages/core/src/tonApiV2/models/DnsRecord.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { WalletDNS } from './WalletDNS'; import { WalletDNSFromJSON, @@ -56,10 +56,8 @@ export interface DnsRecord { * Check if a given object implements the DnsRecord interface. */ export function instanceOfDnsRecord(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "sites" in value; - - return isInstance; + if (!('sites' in value)) return false; + return true; } export function DnsRecordFromJSON(json: any): DnsRecord { @@ -67,31 +65,28 @@ export function DnsRecordFromJSON(json: any): DnsRecord { } export function DnsRecordFromJSONTyped(json: any, ignoreDiscriminator: boolean): DnsRecord { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { - 'wallet': !exists(json, 'wallet') ? undefined : WalletDNSFromJSON(json['wallet']), - 'nextResolver': !exists(json, 'next_resolver') ? undefined : json['next_resolver'], + 'wallet': json['wallet'] == null ? undefined : WalletDNSFromJSON(json['wallet']), + 'nextResolver': json['next_resolver'] == null ? undefined : json['next_resolver'], 'sites': json['sites'], - 'storage': !exists(json, 'storage') ? undefined : json['storage'], + 'storage': json['storage'] == null ? undefined : json['storage'], }; } export function DnsRecordToJSON(value?: DnsRecord | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'wallet': WalletDNSToJSON(value.wallet), - 'next_resolver': value.nextResolver, - 'sites': value.sites, - 'storage': value.storage, + 'wallet': WalletDNSToJSON(value['wallet']), + 'next_resolver': value['nextResolver'], + 'sites': value['sites'], + 'storage': value['storage'], }; } diff --git a/packages/core/src/tonApiV2/models/DomainBid.ts b/packages/core/src/tonApiV2/models/DomainBid.ts index c0946d9f0..9dcba7da8 100644 --- a/packages/core/src/tonApiV2/models/DomainBid.ts +++ b/packages/core/src/tonApiV2/models/DomainBid.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { AccountAddress } from './AccountAddress'; import { AccountAddressFromJSON, @@ -62,14 +62,12 @@ export interface DomainBid { * Check if a given object implements the DomainBid interface. */ export function instanceOfDomainBid(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "success" in value; - isInstance = isInstance && "value" in value; - isInstance = isInstance && "txTime" in value; - isInstance = isInstance && "txHash" in value; - isInstance = isInstance && "bidder" in value; - - return isInstance; + if (!('success' in value)) return false; + if (!('value' in value)) return false; + if (!('txTime' in value)) return false; + if (!('txHash' in value)) return false; + if (!('bidder' in value)) return false; + return true; } export function DomainBidFromJSON(json: any): DomainBid { @@ -77,7 +75,7 @@ export function DomainBidFromJSON(json: any): DomainBid { } export function DomainBidFromJSONTyped(json: any, ignoreDiscriminator: boolean): DomainBid { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -91,19 +89,16 @@ export function DomainBidFromJSONTyped(json: any, ignoreDiscriminator: boolean): } export function DomainBidToJSON(value?: DomainBid | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'success': value.success, - 'value': value.value, - 'txTime': value.txTime, - 'txHash': value.txHash, - 'bidder': AccountAddressToJSON(value.bidder), + 'success': value['success'], + 'value': value['value'], + 'txTime': value['txTime'], + 'txHash': value['txHash'], + 'bidder': AccountAddressToJSON(value['bidder']), }; } diff --git a/packages/core/src/tonApiV2/models/DomainBids.ts b/packages/core/src/tonApiV2/models/DomainBids.ts index 1960cfe3b..4d9f601a0 100644 --- a/packages/core/src/tonApiV2/models/DomainBids.ts +++ b/packages/core/src/tonApiV2/models/DomainBids.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { DomainBid } from './DomainBid'; import { DomainBidFromJSON, @@ -38,10 +38,8 @@ export interface DomainBids { * Check if a given object implements the DomainBids interface. */ export function instanceOfDomainBids(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "data" in value; - - return isInstance; + if (!('data' in value)) return false; + return true; } export function DomainBidsFromJSON(json: any): DomainBids { @@ -49,7 +47,7 @@ export function DomainBidsFromJSON(json: any): DomainBids { } export function DomainBidsFromJSONTyped(json: any, ignoreDiscriminator: boolean): DomainBids { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -59,15 +57,12 @@ export function DomainBidsFromJSONTyped(json: any, ignoreDiscriminator: boolean) } export function DomainBidsToJSON(value?: DomainBids | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'data': ((value.data as Array).map(DomainBidToJSON)), + 'data': ((value['data'] as Array).map(DomainBidToJSON)), }; } diff --git a/packages/core/src/tonApiV2/models/DomainInfo.ts b/packages/core/src/tonApiV2/models/DomainInfo.ts index 1e3828b70..fe6f0cc61 100644 --- a/packages/core/src/tonApiV2/models/DomainInfo.ts +++ b/packages/core/src/tonApiV2/models/DomainInfo.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { NftItem } from './NftItem'; import { NftItemFromJSON, @@ -50,10 +50,8 @@ export interface DomainInfo { * Check if a given object implements the DomainInfo interface. */ export function instanceOfDomainInfo(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "name" in value; - - return isInstance; + if (!('name' in value)) return false; + return true; } export function DomainInfoFromJSON(json: any): DomainInfo { @@ -61,29 +59,26 @@ export function DomainInfoFromJSON(json: any): DomainInfo { } export function DomainInfoFromJSONTyped(json: any, ignoreDiscriminator: boolean): DomainInfo { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'name': json['name'], - 'expiringAt': !exists(json, 'expiring_at') ? undefined : json['expiring_at'], - 'item': !exists(json, 'item') ? undefined : NftItemFromJSON(json['item']), + 'expiringAt': json['expiring_at'] == null ? undefined : json['expiring_at'], + 'item': json['item'] == null ? undefined : NftItemFromJSON(json['item']), }; } export function DomainInfoToJSON(value?: DomainInfo | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'name': value.name, - 'expiring_at': value.expiringAt, - 'item': NftItemToJSON(value.item), + 'name': value['name'], + 'expiring_at': value['expiringAt'], + 'item': NftItemToJSON(value['item']), }; } diff --git a/packages/core/src/tonApiV2/models/DomainNames.ts b/packages/core/src/tonApiV2/models/DomainNames.ts index e15bc2892..c1b5787cd 100644 --- a/packages/core/src/tonApiV2/models/DomainNames.ts +++ b/packages/core/src/tonApiV2/models/DomainNames.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -31,10 +31,8 @@ export interface DomainNames { * Check if a given object implements the DomainNames interface. */ export function instanceOfDomainNames(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "domains" in value; - - return isInstance; + if (!('domains' in value)) return false; + return true; } export function DomainNamesFromJSON(json: any): DomainNames { @@ -42,7 +40,7 @@ export function DomainNamesFromJSON(json: any): DomainNames { } export function DomainNamesFromJSONTyped(json: any, ignoreDiscriminator: boolean): DomainNames { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -52,15 +50,12 @@ export function DomainNamesFromJSONTyped(json: any, ignoreDiscriminator: boolean } export function DomainNamesToJSON(value?: DomainNames | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'domains': value.domains, + 'domains': value['domains'], }; } diff --git a/packages/core/src/tonApiV2/models/DomainRenewAction.ts b/packages/core/src/tonApiV2/models/DomainRenewAction.ts index f199b08f3..e14307ae3 100644 --- a/packages/core/src/tonApiV2/models/DomainRenewAction.ts +++ b/packages/core/src/tonApiV2/models/DomainRenewAction.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { AccountAddress } from './AccountAddress'; import { AccountAddressFromJSON, @@ -50,12 +50,10 @@ export interface DomainRenewAction { * Check if a given object implements the DomainRenewAction interface. */ export function instanceOfDomainRenewAction(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "domain" in value; - isInstance = isInstance && "contractAddress" in value; - isInstance = isInstance && "renewer" in value; - - return isInstance; + if (!('domain' in value)) return false; + if (!('contractAddress' in value)) return false; + if (!('renewer' in value)) return false; + return true; } export function DomainRenewActionFromJSON(json: any): DomainRenewAction { @@ -63,7 +61,7 @@ export function DomainRenewActionFromJSON(json: any): DomainRenewAction { } export function DomainRenewActionFromJSONTyped(json: any, ignoreDiscriminator: boolean): DomainRenewAction { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -75,17 +73,14 @@ export function DomainRenewActionFromJSONTyped(json: any, ignoreDiscriminator: b } export function DomainRenewActionToJSON(value?: DomainRenewAction | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'domain': value.domain, - 'contract_address': value.contractAddress, - 'renewer': AccountAddressToJSON(value.renewer), + 'domain': value['domain'], + 'contract_address': value['contractAddress'], + 'renewer': AccountAddressToJSON(value['renewer']), }; } diff --git a/packages/core/src/tonApiV2/models/ElectionsDepositStakeAction.ts b/packages/core/src/tonApiV2/models/ElectionsDepositStakeAction.ts index 9bc0c1c5e..7d7528dd2 100644 --- a/packages/core/src/tonApiV2/models/ElectionsDepositStakeAction.ts +++ b/packages/core/src/tonApiV2/models/ElectionsDepositStakeAction.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { AccountAddress } from './AccountAddress'; import { AccountAddressFromJSON, @@ -44,11 +44,9 @@ export interface ElectionsDepositStakeAction { * Check if a given object implements the ElectionsDepositStakeAction interface. */ export function instanceOfElectionsDepositStakeAction(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "amount" in value; - isInstance = isInstance && "staker" in value; - - return isInstance; + if (!('amount' in value)) return false; + if (!('staker' in value)) return false; + return true; } export function ElectionsDepositStakeActionFromJSON(json: any): ElectionsDepositStakeAction { @@ -56,7 +54,7 @@ export function ElectionsDepositStakeActionFromJSON(json: any): ElectionsDeposit } export function ElectionsDepositStakeActionFromJSONTyped(json: any, ignoreDiscriminator: boolean): ElectionsDepositStakeAction { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -67,16 +65,13 @@ export function ElectionsDepositStakeActionFromJSONTyped(json: any, ignoreDiscri } export function ElectionsDepositStakeActionToJSON(value?: ElectionsDepositStakeAction | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'amount': value.amount, - 'staker': AccountAddressToJSON(value.staker), + 'amount': value['amount'], + 'staker': AccountAddressToJSON(value['staker']), }; } diff --git a/packages/core/src/tonApiV2/models/ElectionsRecoverStakeAction.ts b/packages/core/src/tonApiV2/models/ElectionsRecoverStakeAction.ts index da352193b..ca007ad24 100644 --- a/packages/core/src/tonApiV2/models/ElectionsRecoverStakeAction.ts +++ b/packages/core/src/tonApiV2/models/ElectionsRecoverStakeAction.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { AccountAddress } from './AccountAddress'; import { AccountAddressFromJSON, @@ -44,11 +44,9 @@ export interface ElectionsRecoverStakeAction { * Check if a given object implements the ElectionsRecoverStakeAction interface. */ export function instanceOfElectionsRecoverStakeAction(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "amount" in value; - isInstance = isInstance && "staker" in value; - - return isInstance; + if (!('amount' in value)) return false; + if (!('staker' in value)) return false; + return true; } export function ElectionsRecoverStakeActionFromJSON(json: any): ElectionsRecoverStakeAction { @@ -56,7 +54,7 @@ export function ElectionsRecoverStakeActionFromJSON(json: any): ElectionsRecover } export function ElectionsRecoverStakeActionFromJSONTyped(json: any, ignoreDiscriminator: boolean): ElectionsRecoverStakeAction { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -67,16 +65,13 @@ export function ElectionsRecoverStakeActionFromJSONTyped(json: any, ignoreDiscri } export function ElectionsRecoverStakeActionToJSON(value?: ElectionsRecoverStakeAction | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'amount': value.amount, - 'staker': AccountAddressToJSON(value.staker), + 'amount': value['amount'], + 'staker': AccountAddressToJSON(value['staker']), }; } diff --git a/packages/core/src/tonApiV2/models/EmulateMessageToWalletRequest.ts b/packages/core/src/tonApiV2/models/EmulateMessageToWalletRequest.ts index f4e1ce7b9..58920c8c0 100644 --- a/packages/core/src/tonApiV2/models/EmulateMessageToWalletRequest.ts +++ b/packages/core/src/tonApiV2/models/EmulateMessageToWalletRequest.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { EmulateMessageToWalletRequestParamsInner } from './EmulateMessageToWalletRequestParamsInner'; import { EmulateMessageToWalletRequestParamsInnerFromJSON, @@ -44,10 +44,8 @@ export interface EmulateMessageToWalletRequest { * Check if a given object implements the EmulateMessageToWalletRequest interface. */ export function instanceOfEmulateMessageToWalletRequest(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "boc" in value; - - return isInstance; + if (!('boc' in value)) return false; + return true; } export function EmulateMessageToWalletRequestFromJSON(json: any): EmulateMessageToWalletRequest { @@ -55,27 +53,24 @@ export function EmulateMessageToWalletRequestFromJSON(json: any): EmulateMessage } export function EmulateMessageToWalletRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): EmulateMessageToWalletRequest { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'boc': json['boc'], - 'params': !exists(json, 'params') ? undefined : ((json['params'] as Array).map(EmulateMessageToWalletRequestParamsInnerFromJSON)), + 'params': json['params'] == null ? undefined : ((json['params'] as Array).map(EmulateMessageToWalletRequestParamsInnerFromJSON)), }; } export function EmulateMessageToWalletRequestToJSON(value?: EmulateMessageToWalletRequest | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'boc': value.boc, - 'params': value.params === undefined ? undefined : ((value.params as Array).map(EmulateMessageToWalletRequestParamsInnerToJSON)), + 'boc': value['boc'], + 'params': value['params'] == null ? undefined : ((value['params'] as Array).map(EmulateMessageToWalletRequestParamsInnerToJSON)), }; } diff --git a/packages/core/src/tonApiV2/models/EmulateMessageToWalletRequestParamsInner.ts b/packages/core/src/tonApiV2/models/EmulateMessageToWalletRequestParamsInner.ts index 1b9c536d7..7d8fd30ad 100644 --- a/packages/core/src/tonApiV2/models/EmulateMessageToWalletRequestParamsInner.ts +++ b/packages/core/src/tonApiV2/models/EmulateMessageToWalletRequestParamsInner.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -37,10 +37,8 @@ export interface EmulateMessageToWalletRequestParamsInner { * Check if a given object implements the EmulateMessageToWalletRequestParamsInner interface. */ export function instanceOfEmulateMessageToWalletRequestParamsInner(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "address" in value; - - return isInstance; + if (!('address' in value)) return false; + return true; } export function EmulateMessageToWalletRequestParamsInnerFromJSON(json: any): EmulateMessageToWalletRequestParamsInner { @@ -48,27 +46,24 @@ export function EmulateMessageToWalletRequestParamsInnerFromJSON(json: any): Emu } export function EmulateMessageToWalletRequestParamsInnerFromJSONTyped(json: any, ignoreDiscriminator: boolean): EmulateMessageToWalletRequestParamsInner { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'address': json['address'], - 'balance': !exists(json, 'balance') ? undefined : json['balance'], + 'balance': json['balance'] == null ? undefined : json['balance'], }; } export function EmulateMessageToWalletRequestParamsInnerToJSON(value?: EmulateMessageToWalletRequestParamsInner | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'address': value.address, - 'balance': value.balance, + 'address': value['address'], + 'balance': value['balance'], }; } diff --git a/packages/core/src/tonApiV2/models/EncryptedComment.ts b/packages/core/src/tonApiV2/models/EncryptedComment.ts index 0902947c5..57dcfa8ad 100644 --- a/packages/core/src/tonApiV2/models/EncryptedComment.ts +++ b/packages/core/src/tonApiV2/models/EncryptedComment.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -37,11 +37,9 @@ export interface EncryptedComment { * Check if a given object implements the EncryptedComment interface. */ export function instanceOfEncryptedComment(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "encryptionType" in value; - isInstance = isInstance && "cipherText" in value; - - return isInstance; + if (!('encryptionType' in value)) return false; + if (!('cipherText' in value)) return false; + return true; } export function EncryptedCommentFromJSON(json: any): EncryptedComment { @@ -49,7 +47,7 @@ export function EncryptedCommentFromJSON(json: any): EncryptedComment { } export function EncryptedCommentFromJSONTyped(json: any, ignoreDiscriminator: boolean): EncryptedComment { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -60,16 +58,13 @@ export function EncryptedCommentFromJSONTyped(json: any, ignoreDiscriminator: bo } export function EncryptedCommentToJSON(value?: EncryptedComment | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'encryption_type': value.encryptionType, - 'cipher_text': value.cipherText, + 'encryption_type': value['encryptionType'], + 'cipher_text': value['cipherText'], }; } diff --git a/packages/core/src/tonApiV2/models/Event.ts b/packages/core/src/tonApiV2/models/Event.ts index bb9a44290..4868b273c 100644 --- a/packages/core/src/tonApiV2/models/Event.ts +++ b/packages/core/src/tonApiV2/models/Event.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { Action } from './Action'; import { ActionFromJSON, @@ -80,16 +80,14 @@ export interface Event { * Check if a given object implements the Event interface. */ export function instanceOfEvent(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "eventId" in value; - isInstance = isInstance && "timestamp" in value; - isInstance = isInstance && "actions" in value; - isInstance = isInstance && "valueFlow" in value; - isInstance = isInstance && "isScam" in value; - isInstance = isInstance && "lt" in value; - isInstance = isInstance && "inProgress" in value; - - return isInstance; + if (!('eventId' in value)) return false; + if (!('timestamp' in value)) return false; + if (!('actions' in value)) return false; + if (!('valueFlow' in value)) return false; + if (!('isScam' in value)) return false; + if (!('lt' in value)) return false; + if (!('inProgress' in value)) return false; + return true; } export function EventFromJSON(json: any): Event { @@ -97,7 +95,7 @@ export function EventFromJSON(json: any): Event { } export function EventFromJSONTyped(json: any, ignoreDiscriminator: boolean): Event { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -113,21 +111,18 @@ export function EventFromJSONTyped(json: any, ignoreDiscriminator: boolean): Eve } export function EventToJSON(value?: Event | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'event_id': value.eventId, - 'timestamp': value.timestamp, - 'actions': ((value.actions as Array).map(ActionToJSON)), - 'value_flow': ((value.valueFlow as Array).map(ValueFlowToJSON)), - 'is_scam': value.isScam, - 'lt': value.lt, - 'in_progress': value.inProgress, + 'event_id': value['eventId'], + 'timestamp': value['timestamp'], + 'actions': ((value['actions'] as Array).map(ActionToJSON)), + 'value_flow': ((value['valueFlow'] as Array).map(ValueFlowToJSON)), + 'is_scam': value['isScam'], + 'lt': value['lt'], + 'in_progress': value['inProgress'], }; } diff --git a/packages/core/src/tonApiV2/models/FoundAccounts.ts b/packages/core/src/tonApiV2/models/FoundAccounts.ts index f292be414..acda357e1 100644 --- a/packages/core/src/tonApiV2/models/FoundAccounts.ts +++ b/packages/core/src/tonApiV2/models/FoundAccounts.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { FoundAccountsAddressesInner } from './FoundAccountsAddressesInner'; import { FoundAccountsAddressesInnerFromJSON, @@ -38,10 +38,8 @@ export interface FoundAccounts { * Check if a given object implements the FoundAccounts interface. */ export function instanceOfFoundAccounts(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "addresses" in value; - - return isInstance; + if (!('addresses' in value)) return false; + return true; } export function FoundAccountsFromJSON(json: any): FoundAccounts { @@ -49,7 +47,7 @@ export function FoundAccountsFromJSON(json: any): FoundAccounts { } export function FoundAccountsFromJSONTyped(json: any, ignoreDiscriminator: boolean): FoundAccounts { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -59,15 +57,12 @@ export function FoundAccountsFromJSONTyped(json: any, ignoreDiscriminator: boole } export function FoundAccountsToJSON(value?: FoundAccounts | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'addresses': ((value.addresses as Array).map(FoundAccountsAddressesInnerToJSON)), + 'addresses': ((value['addresses'] as Array).map(FoundAccountsAddressesInnerToJSON)), }; } diff --git a/packages/core/src/tonApiV2/models/FoundAccountsAddressesInner.ts b/packages/core/src/tonApiV2/models/FoundAccountsAddressesInner.ts index e7000b4b3..a913123dd 100644 --- a/packages/core/src/tonApiV2/models/FoundAccountsAddressesInner.ts +++ b/packages/core/src/tonApiV2/models/FoundAccountsAddressesInner.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -43,12 +43,10 @@ export interface FoundAccountsAddressesInner { * Check if a given object implements the FoundAccountsAddressesInner interface. */ export function instanceOfFoundAccountsAddressesInner(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "address" in value; - isInstance = isInstance && "name" in value; - isInstance = isInstance && "preview" in value; - - return isInstance; + if (!('address' in value)) return false; + if (!('name' in value)) return false; + if (!('preview' in value)) return false; + return true; } export function FoundAccountsAddressesInnerFromJSON(json: any): FoundAccountsAddressesInner { @@ -56,7 +54,7 @@ export function FoundAccountsAddressesInnerFromJSON(json: any): FoundAccountsAdd } export function FoundAccountsAddressesInnerFromJSONTyped(json: any, ignoreDiscriminator: boolean): FoundAccountsAddressesInner { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -68,17 +66,14 @@ export function FoundAccountsAddressesInnerFromJSONTyped(json: any, ignoreDiscri } export function FoundAccountsAddressesInnerToJSON(value?: FoundAccountsAddressesInner | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'address': value.address, - 'name': value.name, - 'preview': value.preview, + 'address': value['address'], + 'name': value['name'], + 'preview': value['preview'], }; } diff --git a/packages/core/src/tonApiV2/models/GasLimitPrices.ts b/packages/core/src/tonApiV2/models/GasLimitPrices.ts index 4d5f78a2f..ec1dc007f 100644 --- a/packages/core/src/tonApiV2/models/GasLimitPrices.ts +++ b/packages/core/src/tonApiV2/models/GasLimitPrices.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -79,15 +79,13 @@ export interface GasLimitPrices { * Check if a given object implements the GasLimitPrices interface. */ export function instanceOfGasLimitPrices(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "gasPrice" in value; - isInstance = isInstance && "gasLimit" in value; - isInstance = isInstance && "gasCredit" in value; - isInstance = isInstance && "blockGasLimit" in value; - isInstance = isInstance && "freezeDueLimit" in value; - isInstance = isInstance && "deleteDueLimit" in value; - - return isInstance; + if (!('gasPrice' in value)) return false; + if (!('gasLimit' in value)) return false; + if (!('gasCredit' in value)) return false; + if (!('blockGasLimit' in value)) return false; + if (!('freezeDueLimit' in value)) return false; + if (!('deleteDueLimit' in value)) return false; + return true; } export function GasLimitPricesFromJSON(json: any): GasLimitPrices { @@ -95,14 +93,14 @@ export function GasLimitPricesFromJSON(json: any): GasLimitPrices { } export function GasLimitPricesFromJSONTyped(json: any, ignoreDiscriminator: boolean): GasLimitPrices { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { - 'specialGasLimit': !exists(json, 'special_gas_limit') ? undefined : json['special_gas_limit'], - 'flatGasLimit': !exists(json, 'flat_gas_limit') ? undefined : json['flat_gas_limit'], - 'flatGasPrice': !exists(json, 'flat_gas_price') ? undefined : json['flat_gas_price'], + 'specialGasLimit': json['special_gas_limit'] == null ? undefined : json['special_gas_limit'], + 'flatGasLimit': json['flat_gas_limit'] == null ? undefined : json['flat_gas_limit'], + 'flatGasPrice': json['flat_gas_price'] == null ? undefined : json['flat_gas_price'], 'gasPrice': json['gas_price'], 'gasLimit': json['gas_limit'], 'gasCredit': json['gas_credit'], @@ -113,23 +111,20 @@ export function GasLimitPricesFromJSONTyped(json: any, ignoreDiscriminator: bool } export function GasLimitPricesToJSON(value?: GasLimitPrices | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'special_gas_limit': value.specialGasLimit, - 'flat_gas_limit': value.flatGasLimit, - 'flat_gas_price': value.flatGasPrice, - 'gas_price': value.gasPrice, - 'gas_limit': value.gasLimit, - 'gas_credit': value.gasCredit, - 'block_gas_limit': value.blockGasLimit, - 'freeze_due_limit': value.freezeDueLimit, - 'delete_due_limit': value.deleteDueLimit, + 'special_gas_limit': value['specialGasLimit'], + 'flat_gas_limit': value['flatGasLimit'], + 'flat_gas_price': value['flatGasPrice'], + 'gas_price': value['gasPrice'], + 'gas_limit': value['gasLimit'], + 'gas_credit': value['gasCredit'], + 'block_gas_limit': value['blockGasLimit'], + 'freeze_due_limit': value['freezeDueLimit'], + 'delete_due_limit': value['deleteDueLimit'], }; } diff --git a/packages/core/src/tonApiV2/models/GetAccountDiff200Response.ts b/packages/core/src/tonApiV2/models/GetAccountDiff200Response.ts index 268158cbf..8e8879189 100644 --- a/packages/core/src/tonApiV2/models/GetAccountDiff200Response.ts +++ b/packages/core/src/tonApiV2/models/GetAccountDiff200Response.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -31,10 +31,8 @@ export interface GetAccountDiff200Response { * Check if a given object implements the GetAccountDiff200Response interface. */ export function instanceOfGetAccountDiff200Response(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "balanceChange" in value; - - return isInstance; + if (!('balanceChange' in value)) return false; + return true; } export function GetAccountDiff200ResponseFromJSON(json: any): GetAccountDiff200Response { @@ -42,7 +40,7 @@ export function GetAccountDiff200ResponseFromJSON(json: any): GetAccountDiff200R } export function GetAccountDiff200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): GetAccountDiff200Response { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -52,15 +50,12 @@ export function GetAccountDiff200ResponseFromJSONTyped(json: any, ignoreDiscrimi } export function GetAccountDiff200ResponseToJSON(value?: GetAccountDiff200Response | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'balance_change': value.balanceChange, + 'balance_change': value['balanceChange'], }; } diff --git a/packages/core/src/tonApiV2/models/GetAccountInfoByStateInitRequest.ts b/packages/core/src/tonApiV2/models/GetAccountInfoByStateInitRequest.ts index e7ed8a1c3..60327f2a1 100644 --- a/packages/core/src/tonApiV2/models/GetAccountInfoByStateInitRequest.ts +++ b/packages/core/src/tonApiV2/models/GetAccountInfoByStateInitRequest.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -31,10 +31,8 @@ export interface GetAccountInfoByStateInitRequest { * Check if a given object implements the GetAccountInfoByStateInitRequest interface. */ export function instanceOfGetAccountInfoByStateInitRequest(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "stateInit" in value; - - return isInstance; + if (!('stateInit' in value)) return false; + return true; } export function GetAccountInfoByStateInitRequestFromJSON(json: any): GetAccountInfoByStateInitRequest { @@ -42,7 +40,7 @@ export function GetAccountInfoByStateInitRequestFromJSON(json: any): GetAccountI } export function GetAccountInfoByStateInitRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): GetAccountInfoByStateInitRequest { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -52,15 +50,12 @@ export function GetAccountInfoByStateInitRequestFromJSONTyped(json: any, ignoreD } export function GetAccountInfoByStateInitRequestToJSON(value?: GetAccountInfoByStateInitRequest | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'state_init': value.stateInit, + 'state_init': value['stateInit'], }; } diff --git a/packages/core/src/tonApiV2/models/GetAccountPublicKey200Response.ts b/packages/core/src/tonApiV2/models/GetAccountPublicKey200Response.ts index 44e3293bd..a285badd2 100644 --- a/packages/core/src/tonApiV2/models/GetAccountPublicKey200Response.ts +++ b/packages/core/src/tonApiV2/models/GetAccountPublicKey200Response.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -31,10 +31,8 @@ export interface GetAccountPublicKey200Response { * Check if a given object implements the GetAccountPublicKey200Response interface. */ export function instanceOfGetAccountPublicKey200Response(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "publicKey" in value; - - return isInstance; + if (!('publicKey' in value)) return false; + return true; } export function GetAccountPublicKey200ResponseFromJSON(json: any): GetAccountPublicKey200Response { @@ -42,7 +40,7 @@ export function GetAccountPublicKey200ResponseFromJSON(json: any): GetAccountPub } export function GetAccountPublicKey200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): GetAccountPublicKey200Response { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -52,15 +50,12 @@ export function GetAccountPublicKey200ResponseFromJSONTyped(json: any, ignoreDis } export function GetAccountPublicKey200ResponseToJSON(value?: GetAccountPublicKey200Response | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'public_key': value.publicKey, + 'public_key': value['publicKey'], }; } diff --git a/packages/core/src/tonApiV2/models/GetAccountsRequest.ts b/packages/core/src/tonApiV2/models/GetAccountsRequest.ts index cf9ec1de6..6fc515cc2 100644 --- a/packages/core/src/tonApiV2/models/GetAccountsRequest.ts +++ b/packages/core/src/tonApiV2/models/GetAccountsRequest.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -31,10 +31,8 @@ export interface GetAccountsRequest { * Check if a given object implements the GetAccountsRequest interface. */ export function instanceOfGetAccountsRequest(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "accountIds" in value; - - return isInstance; + if (!('accountIds' in value)) return false; + return true; } export function GetAccountsRequestFromJSON(json: any): GetAccountsRequest { @@ -42,7 +40,7 @@ export function GetAccountsRequestFromJSON(json: any): GetAccountsRequest { } export function GetAccountsRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): GetAccountsRequest { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -52,15 +50,12 @@ export function GetAccountsRequestFromJSONTyped(json: any, ignoreDiscriminator: } export function GetAccountsRequestToJSON(value?: GetAccountsRequest | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'account_ids': value.accountIds, + 'account_ids': value['accountIds'], }; } diff --git a/packages/core/src/tonApiV2/models/GetAllRawShardsInfo200Response.ts b/packages/core/src/tonApiV2/models/GetAllRawShardsInfo200Response.ts index 478b0df38..7caddda07 100644 --- a/packages/core/src/tonApiV2/models/GetAllRawShardsInfo200Response.ts +++ b/packages/core/src/tonApiV2/models/GetAllRawShardsInfo200Response.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { BlockRaw } from './BlockRaw'; import { BlockRawFromJSON, @@ -50,12 +50,10 @@ export interface GetAllRawShardsInfo200Response { * Check if a given object implements the GetAllRawShardsInfo200Response interface. */ export function instanceOfGetAllRawShardsInfo200Response(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "id" in value; - isInstance = isInstance && "proof" in value; - isInstance = isInstance && "data" in value; - - return isInstance; + if (!('id' in value)) return false; + if (!('proof' in value)) return false; + if (!('data' in value)) return false; + return true; } export function GetAllRawShardsInfo200ResponseFromJSON(json: any): GetAllRawShardsInfo200Response { @@ -63,7 +61,7 @@ export function GetAllRawShardsInfo200ResponseFromJSON(json: any): GetAllRawShar } export function GetAllRawShardsInfo200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): GetAllRawShardsInfo200Response { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -75,17 +73,14 @@ export function GetAllRawShardsInfo200ResponseFromJSONTyped(json: any, ignoreDis } export function GetAllRawShardsInfo200ResponseToJSON(value?: GetAllRawShardsInfo200Response | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'id': BlockRawToJSON(value.id), - 'proof': value.proof, - 'data': value.data, + 'id': BlockRawToJSON(value['id']), + 'proof': value['proof'], + 'data': value['data'], }; } diff --git a/packages/core/src/tonApiV2/models/GetBlockchainBlockDefaultResponse.ts b/packages/core/src/tonApiV2/models/GetBlockchainBlockDefaultResponse.ts deleted file mode 100644 index 5cb059f13..000000000 --- a/packages/core/src/tonApiV2/models/GetBlockchainBlockDefaultResponse.ts +++ /dev/null @@ -1,66 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * REST api to TON blockchain explorer - * Provide access to indexed TON blockchain - * - * The version of the OpenAPI document: 2.0.0 - * Contact: support@tonkeeper.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { exists, mapValues } from '../runtime'; -/** - * - * @export - * @interface GetBlockchainBlockDefaultResponse - */ -export interface GetBlockchainBlockDefaultResponse { - /** - * - * @type {string} - * @memberof GetBlockchainBlockDefaultResponse - */ - error: string; -} - -/** - * Check if a given object implements the GetBlockchainBlockDefaultResponse interface. - */ -export function instanceOfGetBlockchainBlockDefaultResponse(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "error" in value; - - return isInstance; -} - -export function GetBlockchainBlockDefaultResponseFromJSON(json: any): GetBlockchainBlockDefaultResponse { - return GetBlockchainBlockDefaultResponseFromJSONTyped(json, false); -} - -export function GetBlockchainBlockDefaultResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): GetBlockchainBlockDefaultResponse { - if ((json === undefined) || (json === null)) { - return json; - } - return { - - 'error': json['error'], - }; -} - -export function GetBlockchainBlockDefaultResponseToJSON(value?: GetBlockchainBlockDefaultResponse | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; - } - return { - - 'error': value.error, - }; -} - diff --git a/packages/core/src/tonApiV2/models/GetChartRates200Response.ts b/packages/core/src/tonApiV2/models/GetChartRates200Response.ts index c8c111db1..36c8363b0 100644 --- a/packages/core/src/tonApiV2/models/GetChartRates200Response.ts +++ b/packages/core/src/tonApiV2/models/GetChartRates200Response.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -31,10 +31,8 @@ export interface GetChartRates200Response { * Check if a given object implements the GetChartRates200Response interface. */ export function instanceOfGetChartRates200Response(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "points" in value; - - return isInstance; + if (!('points' in value)) return false; + return true; } export function GetChartRates200ResponseFromJSON(json: any): GetChartRates200Response { @@ -42,7 +40,7 @@ export function GetChartRates200ResponseFromJSON(json: any): GetChartRates200Res } export function GetChartRates200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): GetChartRates200Response { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -52,15 +50,12 @@ export function GetChartRates200ResponseFromJSONTyped(json: any, ignoreDiscrimin } export function GetChartRates200ResponseToJSON(value?: GetChartRates200Response | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'points': value.points, + 'points': value['points'], }; } diff --git a/packages/core/src/tonApiV2/models/GetInscriptionOpTemplate200Response.ts b/packages/core/src/tonApiV2/models/GetInscriptionOpTemplate200Response.ts index 849a1bafc..240811678 100644 --- a/packages/core/src/tonApiV2/models/GetInscriptionOpTemplate200Response.ts +++ b/packages/core/src/tonApiV2/models/GetInscriptionOpTemplate200Response.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -37,11 +37,9 @@ export interface GetInscriptionOpTemplate200Response { * Check if a given object implements the GetInscriptionOpTemplate200Response interface. */ export function instanceOfGetInscriptionOpTemplate200Response(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "comment" in value; - isInstance = isInstance && "destination" in value; - - return isInstance; + if (!('comment' in value)) return false; + if (!('destination' in value)) return false; + return true; } export function GetInscriptionOpTemplate200ResponseFromJSON(json: any): GetInscriptionOpTemplate200Response { @@ -49,7 +47,7 @@ export function GetInscriptionOpTemplate200ResponseFromJSON(json: any): GetInscr } export function GetInscriptionOpTemplate200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): GetInscriptionOpTemplate200Response { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -60,16 +58,13 @@ export function GetInscriptionOpTemplate200ResponseFromJSONTyped(json: any, igno } export function GetInscriptionOpTemplate200ResponseToJSON(value?: GetInscriptionOpTemplate200Response | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'comment': value.comment, - 'destination': value.destination, + 'comment': value['comment'], + 'destination': value['destination'], }; } diff --git a/packages/core/src/tonApiV2/models/GetRates200Response.ts b/packages/core/src/tonApiV2/models/GetRates200Response.ts index b912b6b2d..52b17779b 100644 --- a/packages/core/src/tonApiV2/models/GetRates200Response.ts +++ b/packages/core/src/tonApiV2/models/GetRates200Response.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { TokenRates } from './TokenRates'; import { TokenRatesFromJSON, @@ -38,10 +38,8 @@ export interface GetRates200Response { * Check if a given object implements the GetRates200Response interface. */ export function instanceOfGetRates200Response(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "rates" in value; - - return isInstance; + if (!('rates' in value)) return false; + return true; } export function GetRates200ResponseFromJSON(json: any): GetRates200Response { @@ -49,7 +47,7 @@ export function GetRates200ResponseFromJSON(json: any): GetRates200Response { } export function GetRates200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): GetRates200Response { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -59,15 +57,12 @@ export function GetRates200ResponseFromJSONTyped(json: any, ignoreDiscriminator: } export function GetRates200ResponseToJSON(value?: GetRates200Response | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'rates': (mapValues(value.rates, TokenRatesToJSON)), + 'rates': (mapValues(value['rates'], TokenRatesToJSON)), }; } diff --git a/packages/core/src/tonApiV2/models/GetRawAccountState200Response.ts b/packages/core/src/tonApiV2/models/GetRawAccountState200Response.ts index 4bbb1ae2f..2e7298a71 100644 --- a/packages/core/src/tonApiV2/models/GetRawAccountState200Response.ts +++ b/packages/core/src/tonApiV2/models/GetRawAccountState200Response.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { BlockRaw } from './BlockRaw'; import { BlockRawFromJSON, @@ -62,14 +62,12 @@ export interface GetRawAccountState200Response { * Check if a given object implements the GetRawAccountState200Response interface. */ export function instanceOfGetRawAccountState200Response(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "id" in value; - isInstance = isInstance && "shardblk" in value; - isInstance = isInstance && "shardProof" in value; - isInstance = isInstance && "proof" in value; - isInstance = isInstance && "state" in value; - - return isInstance; + if (!('id' in value)) return false; + if (!('shardblk' in value)) return false; + if (!('shardProof' in value)) return false; + if (!('proof' in value)) return false; + if (!('state' in value)) return false; + return true; } export function GetRawAccountState200ResponseFromJSON(json: any): GetRawAccountState200Response { @@ -77,7 +75,7 @@ export function GetRawAccountState200ResponseFromJSON(json: any): GetRawAccountS } export function GetRawAccountState200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): GetRawAccountState200Response { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -91,19 +89,16 @@ export function GetRawAccountState200ResponseFromJSONTyped(json: any, ignoreDisc } export function GetRawAccountState200ResponseToJSON(value?: GetRawAccountState200Response | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'id': BlockRawToJSON(value.id), - 'shardblk': BlockRawToJSON(value.shardblk), - 'shard_proof': value.shardProof, - 'proof': value.proof, - 'state': value.state, + 'id': BlockRawToJSON(value['id']), + 'shardblk': BlockRawToJSON(value['shardblk']), + 'shard_proof': value['shardProof'], + 'proof': value['proof'], + 'state': value['state'], }; } diff --git a/packages/core/src/tonApiV2/models/GetRawBlockProof200Response.ts b/packages/core/src/tonApiV2/models/GetRawBlockProof200Response.ts index 3f31c7e2e..6399ed9d3 100644 --- a/packages/core/src/tonApiV2/models/GetRawBlockProof200Response.ts +++ b/packages/core/src/tonApiV2/models/GetRawBlockProof200Response.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { BlockRaw } from './BlockRaw'; import { BlockRawFromJSON, @@ -62,13 +62,11 @@ export interface GetRawBlockProof200Response { * Check if a given object implements the GetRawBlockProof200Response interface. */ export function instanceOfGetRawBlockProof200Response(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "complete" in value; - isInstance = isInstance && "from" in value; - isInstance = isInstance && "to" in value; - isInstance = isInstance && "steps" in value; - - return isInstance; + if (!('complete' in value)) return false; + if (!('from' in value)) return false; + if (!('to' in value)) return false; + if (!('steps' in value)) return false; + return true; } export function GetRawBlockProof200ResponseFromJSON(json: any): GetRawBlockProof200Response { @@ -76,7 +74,7 @@ export function GetRawBlockProof200ResponseFromJSON(json: any): GetRawBlockProof } export function GetRawBlockProof200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): GetRawBlockProof200Response { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -89,18 +87,15 @@ export function GetRawBlockProof200ResponseFromJSONTyped(json: any, ignoreDiscri } export function GetRawBlockProof200ResponseToJSON(value?: GetRawBlockProof200Response | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'complete': value.complete, - 'from': BlockRawToJSON(value.from), - 'to': BlockRawToJSON(value.to), - 'steps': ((value.steps as Array).map(GetRawBlockProof200ResponseStepsInnerToJSON)), + 'complete': value['complete'], + 'from': BlockRawToJSON(value['from']), + 'to': BlockRawToJSON(value['to']), + 'steps': ((value['steps'] as Array).map(GetRawBlockProof200ResponseStepsInnerToJSON)), }; } diff --git a/packages/core/src/tonApiV2/models/GetRawBlockProof200ResponseStepsInner.ts b/packages/core/src/tonApiV2/models/GetRawBlockProof200ResponseStepsInner.ts index 257736dae..ddf62c56f 100644 --- a/packages/core/src/tonApiV2/models/GetRawBlockProof200ResponseStepsInner.ts +++ b/packages/core/src/tonApiV2/models/GetRawBlockProof200ResponseStepsInner.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { GetRawBlockProof200ResponseStepsInnerLiteServerBlockLinkBack } from './GetRawBlockProof200ResponseStepsInnerLiteServerBlockLinkBack'; import { GetRawBlockProof200ResponseStepsInnerLiteServerBlockLinkBackFromJSON, @@ -50,11 +50,9 @@ export interface GetRawBlockProof200ResponseStepsInner { * Check if a given object implements the GetRawBlockProof200ResponseStepsInner interface. */ export function instanceOfGetRawBlockProof200ResponseStepsInner(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "liteServerBlockLinkBack" in value; - isInstance = isInstance && "liteServerBlockLinkForward" in value; - - return isInstance; + if (!('liteServerBlockLinkBack' in value)) return false; + if (!('liteServerBlockLinkForward' in value)) return false; + return true; } export function GetRawBlockProof200ResponseStepsInnerFromJSON(json: any): GetRawBlockProof200ResponseStepsInner { @@ -62,7 +60,7 @@ export function GetRawBlockProof200ResponseStepsInnerFromJSON(json: any): GetRaw } export function GetRawBlockProof200ResponseStepsInnerFromJSONTyped(json: any, ignoreDiscriminator: boolean): GetRawBlockProof200ResponseStepsInner { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -73,16 +71,13 @@ export function GetRawBlockProof200ResponseStepsInnerFromJSONTyped(json: any, ig } export function GetRawBlockProof200ResponseStepsInnerToJSON(value?: GetRawBlockProof200ResponseStepsInner | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'lite_server_block_link_back': GetRawBlockProof200ResponseStepsInnerLiteServerBlockLinkBackToJSON(value.liteServerBlockLinkBack), - 'lite_server_block_link_forward': GetRawBlockProof200ResponseStepsInnerLiteServerBlockLinkForwardToJSON(value.liteServerBlockLinkForward), + 'lite_server_block_link_back': GetRawBlockProof200ResponseStepsInnerLiteServerBlockLinkBackToJSON(value['liteServerBlockLinkBack']), + 'lite_server_block_link_forward': GetRawBlockProof200ResponseStepsInnerLiteServerBlockLinkForwardToJSON(value['liteServerBlockLinkForward']), }; } diff --git a/packages/core/src/tonApiV2/models/GetRawBlockProof200ResponseStepsInnerLiteServerBlockLinkBack.ts b/packages/core/src/tonApiV2/models/GetRawBlockProof200ResponseStepsInnerLiteServerBlockLinkBack.ts index 3b1047c55..7cd5b45d0 100644 --- a/packages/core/src/tonApiV2/models/GetRawBlockProof200ResponseStepsInnerLiteServerBlockLinkBack.ts +++ b/packages/core/src/tonApiV2/models/GetRawBlockProof200ResponseStepsInnerLiteServerBlockLinkBack.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { BlockRaw } from './BlockRaw'; import { BlockRawFromJSON, @@ -68,15 +68,13 @@ export interface GetRawBlockProof200ResponseStepsInnerLiteServerBlockLinkBack { * Check if a given object implements the GetRawBlockProof200ResponseStepsInnerLiteServerBlockLinkBack interface. */ export function instanceOfGetRawBlockProof200ResponseStepsInnerLiteServerBlockLinkBack(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "toKeyBlock" in value; - isInstance = isInstance && "from" in value; - isInstance = isInstance && "to" in value; - isInstance = isInstance && "destProof" in value; - isInstance = isInstance && "proof" in value; - isInstance = isInstance && "stateProof" in value; - - return isInstance; + if (!('toKeyBlock' in value)) return false; + if (!('from' in value)) return false; + if (!('to' in value)) return false; + if (!('destProof' in value)) return false; + if (!('proof' in value)) return false; + if (!('stateProof' in value)) return false; + return true; } export function GetRawBlockProof200ResponseStepsInnerLiteServerBlockLinkBackFromJSON(json: any): GetRawBlockProof200ResponseStepsInnerLiteServerBlockLinkBack { @@ -84,7 +82,7 @@ export function GetRawBlockProof200ResponseStepsInnerLiteServerBlockLinkBackFrom } export function GetRawBlockProof200ResponseStepsInnerLiteServerBlockLinkBackFromJSONTyped(json: any, ignoreDiscriminator: boolean): GetRawBlockProof200ResponseStepsInnerLiteServerBlockLinkBack { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -99,20 +97,17 @@ export function GetRawBlockProof200ResponseStepsInnerLiteServerBlockLinkBackFrom } export function GetRawBlockProof200ResponseStepsInnerLiteServerBlockLinkBackToJSON(value?: GetRawBlockProof200ResponseStepsInnerLiteServerBlockLinkBack | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'to_key_block': value.toKeyBlock, - 'from': BlockRawToJSON(value.from), - 'to': BlockRawToJSON(value.to), - 'dest_proof': value.destProof, - 'proof': value.proof, - 'state_proof': value.stateProof, + 'to_key_block': value['toKeyBlock'], + 'from': BlockRawToJSON(value['from']), + 'to': BlockRawToJSON(value['to']), + 'dest_proof': value['destProof'], + 'proof': value['proof'], + 'state_proof': value['stateProof'], }; } diff --git a/packages/core/src/tonApiV2/models/GetRawBlockProof200ResponseStepsInnerLiteServerBlockLinkForward.ts b/packages/core/src/tonApiV2/models/GetRawBlockProof200ResponseStepsInnerLiteServerBlockLinkForward.ts index 859fd8170..cf1ddfe29 100644 --- a/packages/core/src/tonApiV2/models/GetRawBlockProof200ResponseStepsInnerLiteServerBlockLinkForward.ts +++ b/packages/core/src/tonApiV2/models/GetRawBlockProof200ResponseStepsInnerLiteServerBlockLinkForward.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { BlockRaw } from './BlockRaw'; import { BlockRawFromJSON, @@ -74,15 +74,13 @@ export interface GetRawBlockProof200ResponseStepsInnerLiteServerBlockLinkForward * Check if a given object implements the GetRawBlockProof200ResponseStepsInnerLiteServerBlockLinkForward interface. */ export function instanceOfGetRawBlockProof200ResponseStepsInnerLiteServerBlockLinkForward(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "toKeyBlock" in value; - isInstance = isInstance && "from" in value; - isInstance = isInstance && "to" in value; - isInstance = isInstance && "destProof" in value; - isInstance = isInstance && "configProof" in value; - isInstance = isInstance && "signatures" in value; - - return isInstance; + if (!('toKeyBlock' in value)) return false; + if (!('from' in value)) return false; + if (!('to' in value)) return false; + if (!('destProof' in value)) return false; + if (!('configProof' in value)) return false; + if (!('signatures' in value)) return false; + return true; } export function GetRawBlockProof200ResponseStepsInnerLiteServerBlockLinkForwardFromJSON(json: any): GetRawBlockProof200ResponseStepsInnerLiteServerBlockLinkForward { @@ -90,7 +88,7 @@ export function GetRawBlockProof200ResponseStepsInnerLiteServerBlockLinkForwardF } export function GetRawBlockProof200ResponseStepsInnerLiteServerBlockLinkForwardFromJSONTyped(json: any, ignoreDiscriminator: boolean): GetRawBlockProof200ResponseStepsInnerLiteServerBlockLinkForward { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -105,20 +103,17 @@ export function GetRawBlockProof200ResponseStepsInnerLiteServerBlockLinkForwardF } export function GetRawBlockProof200ResponseStepsInnerLiteServerBlockLinkForwardToJSON(value?: GetRawBlockProof200ResponseStepsInnerLiteServerBlockLinkForward | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'to_key_block': value.toKeyBlock, - 'from': BlockRawToJSON(value.from), - 'to': BlockRawToJSON(value.to), - 'dest_proof': value.destProof, - 'config_proof': value.configProof, - 'signatures': GetRawBlockProof200ResponseStepsInnerLiteServerBlockLinkForwardSignaturesToJSON(value.signatures), + 'to_key_block': value['toKeyBlock'], + 'from': BlockRawToJSON(value['from']), + 'to': BlockRawToJSON(value['to']), + 'dest_proof': value['destProof'], + 'config_proof': value['configProof'], + 'signatures': GetRawBlockProof200ResponseStepsInnerLiteServerBlockLinkForwardSignaturesToJSON(value['signatures']), }; } diff --git a/packages/core/src/tonApiV2/models/GetRawBlockProof200ResponseStepsInnerLiteServerBlockLinkForwardSignatures.ts b/packages/core/src/tonApiV2/models/GetRawBlockProof200ResponseStepsInnerLiteServerBlockLinkForwardSignatures.ts index 38000a505..4bdd0068f 100644 --- a/packages/core/src/tonApiV2/models/GetRawBlockProof200ResponseStepsInnerLiteServerBlockLinkForwardSignatures.ts +++ b/packages/core/src/tonApiV2/models/GetRawBlockProof200ResponseStepsInnerLiteServerBlockLinkForwardSignatures.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { GetRawBlockProof200ResponseStepsInnerLiteServerBlockLinkForwardSignaturesSignaturesInner } from './GetRawBlockProof200ResponseStepsInnerLiteServerBlockLinkForwardSignaturesSignaturesInner'; import { GetRawBlockProof200ResponseStepsInnerLiteServerBlockLinkForwardSignaturesSignaturesInnerFromJSON, @@ -50,12 +50,10 @@ export interface GetRawBlockProof200ResponseStepsInnerLiteServerBlockLinkForward * Check if a given object implements the GetRawBlockProof200ResponseStepsInnerLiteServerBlockLinkForwardSignatures interface. */ export function instanceOfGetRawBlockProof200ResponseStepsInnerLiteServerBlockLinkForwardSignatures(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "validatorSetHash" in value; - isInstance = isInstance && "catchainSeqno" in value; - isInstance = isInstance && "signatures" in value; - - return isInstance; + if (!('validatorSetHash' in value)) return false; + if (!('catchainSeqno' in value)) return false; + if (!('signatures' in value)) return false; + return true; } export function GetRawBlockProof200ResponseStepsInnerLiteServerBlockLinkForwardSignaturesFromJSON(json: any): GetRawBlockProof200ResponseStepsInnerLiteServerBlockLinkForwardSignatures { @@ -63,7 +61,7 @@ export function GetRawBlockProof200ResponseStepsInnerLiteServerBlockLinkForwardS } export function GetRawBlockProof200ResponseStepsInnerLiteServerBlockLinkForwardSignaturesFromJSONTyped(json: any, ignoreDiscriminator: boolean): GetRawBlockProof200ResponseStepsInnerLiteServerBlockLinkForwardSignatures { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -75,17 +73,14 @@ export function GetRawBlockProof200ResponseStepsInnerLiteServerBlockLinkForwardS } export function GetRawBlockProof200ResponseStepsInnerLiteServerBlockLinkForwardSignaturesToJSON(value?: GetRawBlockProof200ResponseStepsInnerLiteServerBlockLinkForwardSignatures | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'validator_set_hash': value.validatorSetHash, - 'catchain_seqno': value.catchainSeqno, - 'signatures': ((value.signatures as Array).map(GetRawBlockProof200ResponseStepsInnerLiteServerBlockLinkForwardSignaturesSignaturesInnerToJSON)), + 'validator_set_hash': value['validatorSetHash'], + 'catchain_seqno': value['catchainSeqno'], + 'signatures': ((value['signatures'] as Array).map(GetRawBlockProof200ResponseStepsInnerLiteServerBlockLinkForwardSignaturesSignaturesInnerToJSON)), }; } diff --git a/packages/core/src/tonApiV2/models/GetRawBlockProof200ResponseStepsInnerLiteServerBlockLinkForwardSignaturesSignaturesInner.ts b/packages/core/src/tonApiV2/models/GetRawBlockProof200ResponseStepsInnerLiteServerBlockLinkForwardSignaturesSignaturesInner.ts index c8ff130ec..62ecbaf5e 100644 --- a/packages/core/src/tonApiV2/models/GetRawBlockProof200ResponseStepsInnerLiteServerBlockLinkForwardSignaturesSignaturesInner.ts +++ b/packages/core/src/tonApiV2/models/GetRawBlockProof200ResponseStepsInnerLiteServerBlockLinkForwardSignaturesSignaturesInner.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -37,11 +37,9 @@ export interface GetRawBlockProof200ResponseStepsInnerLiteServerBlockLinkForward * Check if a given object implements the GetRawBlockProof200ResponseStepsInnerLiteServerBlockLinkForwardSignaturesSignaturesInner interface. */ export function instanceOfGetRawBlockProof200ResponseStepsInnerLiteServerBlockLinkForwardSignaturesSignaturesInner(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "nodeIdShort" in value; - isInstance = isInstance && "signature" in value; - - return isInstance; + if (!('nodeIdShort' in value)) return false; + if (!('signature' in value)) return false; + return true; } export function GetRawBlockProof200ResponseStepsInnerLiteServerBlockLinkForwardSignaturesSignaturesInnerFromJSON(json: any): GetRawBlockProof200ResponseStepsInnerLiteServerBlockLinkForwardSignaturesSignaturesInner { @@ -49,7 +47,7 @@ export function GetRawBlockProof200ResponseStepsInnerLiteServerBlockLinkForwardS } export function GetRawBlockProof200ResponseStepsInnerLiteServerBlockLinkForwardSignaturesSignaturesInnerFromJSONTyped(json: any, ignoreDiscriminator: boolean): GetRawBlockProof200ResponseStepsInnerLiteServerBlockLinkForwardSignaturesSignaturesInner { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -60,16 +58,13 @@ export function GetRawBlockProof200ResponseStepsInnerLiteServerBlockLinkForwardS } export function GetRawBlockProof200ResponseStepsInnerLiteServerBlockLinkForwardSignaturesSignaturesInnerToJSON(value?: GetRawBlockProof200ResponseStepsInnerLiteServerBlockLinkForwardSignaturesSignaturesInner | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'node_id_short': value.nodeIdShort, - 'signature': value.signature, + 'node_id_short': value['nodeIdShort'], + 'signature': value['signature'], }; } diff --git a/packages/core/src/tonApiV2/models/GetRawBlockchainBlock200Response.ts b/packages/core/src/tonApiV2/models/GetRawBlockchainBlock200Response.ts index a9f5ac6ba..91ae7988a 100644 --- a/packages/core/src/tonApiV2/models/GetRawBlockchainBlock200Response.ts +++ b/packages/core/src/tonApiV2/models/GetRawBlockchainBlock200Response.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { BlockRaw } from './BlockRaw'; import { BlockRawFromJSON, @@ -44,11 +44,9 @@ export interface GetRawBlockchainBlock200Response { * Check if a given object implements the GetRawBlockchainBlock200Response interface. */ export function instanceOfGetRawBlockchainBlock200Response(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "id" in value; - isInstance = isInstance && "data" in value; - - return isInstance; + if (!('id' in value)) return false; + if (!('data' in value)) return false; + return true; } export function GetRawBlockchainBlock200ResponseFromJSON(json: any): GetRawBlockchainBlock200Response { @@ -56,7 +54,7 @@ export function GetRawBlockchainBlock200ResponseFromJSON(json: any): GetRawBlock } export function GetRawBlockchainBlock200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): GetRawBlockchainBlock200Response { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -67,16 +65,13 @@ export function GetRawBlockchainBlock200ResponseFromJSONTyped(json: any, ignoreD } export function GetRawBlockchainBlock200ResponseToJSON(value?: GetRawBlockchainBlock200Response | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'id': BlockRawToJSON(value.id), - 'data': value.data, + 'id': BlockRawToJSON(value['id']), + 'data': value['data'], }; } diff --git a/packages/core/src/tonApiV2/models/GetRawBlockchainBlockHeader200Response.ts b/packages/core/src/tonApiV2/models/GetRawBlockchainBlockHeader200Response.ts index 0a5699ec4..70d61fe20 100644 --- a/packages/core/src/tonApiV2/models/GetRawBlockchainBlockHeader200Response.ts +++ b/packages/core/src/tonApiV2/models/GetRawBlockchainBlockHeader200Response.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { BlockRaw } from './BlockRaw'; import { BlockRawFromJSON, @@ -50,12 +50,10 @@ export interface GetRawBlockchainBlockHeader200Response { * Check if a given object implements the GetRawBlockchainBlockHeader200Response interface. */ export function instanceOfGetRawBlockchainBlockHeader200Response(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "id" in value; - isInstance = isInstance && "mode" in value; - isInstance = isInstance && "headerProof" in value; - - return isInstance; + if (!('id' in value)) return false; + if (!('mode' in value)) return false; + if (!('headerProof' in value)) return false; + return true; } export function GetRawBlockchainBlockHeader200ResponseFromJSON(json: any): GetRawBlockchainBlockHeader200Response { @@ -63,7 +61,7 @@ export function GetRawBlockchainBlockHeader200ResponseFromJSON(json: any): GetRa } export function GetRawBlockchainBlockHeader200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): GetRawBlockchainBlockHeader200Response { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -75,17 +73,14 @@ export function GetRawBlockchainBlockHeader200ResponseFromJSONTyped(json: any, i } export function GetRawBlockchainBlockHeader200ResponseToJSON(value?: GetRawBlockchainBlockHeader200Response | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'id': BlockRawToJSON(value.id), - 'mode': value.mode, - 'header_proof': value.headerProof, + 'id': BlockRawToJSON(value['id']), + 'mode': value['mode'], + 'header_proof': value['headerProof'], }; } diff --git a/packages/core/src/tonApiV2/models/GetRawBlockchainBlockState200Response.ts b/packages/core/src/tonApiV2/models/GetRawBlockchainBlockState200Response.ts index 40fbab3bb..385033021 100644 --- a/packages/core/src/tonApiV2/models/GetRawBlockchainBlockState200Response.ts +++ b/packages/core/src/tonApiV2/models/GetRawBlockchainBlockState200Response.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { BlockRaw } from './BlockRaw'; import { BlockRawFromJSON, @@ -56,13 +56,11 @@ export interface GetRawBlockchainBlockState200Response { * Check if a given object implements the GetRawBlockchainBlockState200Response interface. */ export function instanceOfGetRawBlockchainBlockState200Response(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "id" in value; - isInstance = isInstance && "rootHash" in value; - isInstance = isInstance && "fileHash" in value; - isInstance = isInstance && "data" in value; - - return isInstance; + if (!('id' in value)) return false; + if (!('rootHash' in value)) return false; + if (!('fileHash' in value)) return false; + if (!('data' in value)) return false; + return true; } export function GetRawBlockchainBlockState200ResponseFromJSON(json: any): GetRawBlockchainBlockState200Response { @@ -70,7 +68,7 @@ export function GetRawBlockchainBlockState200ResponseFromJSON(json: any): GetRaw } export function GetRawBlockchainBlockState200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): GetRawBlockchainBlockState200Response { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -83,18 +81,15 @@ export function GetRawBlockchainBlockState200ResponseFromJSONTyped(json: any, ig } export function GetRawBlockchainBlockState200ResponseToJSON(value?: GetRawBlockchainBlockState200Response | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'id': BlockRawToJSON(value.id), - 'root_hash': value.rootHash, - 'file_hash': value.fileHash, - 'data': value.data, + 'id': BlockRawToJSON(value['id']), + 'root_hash': value['rootHash'], + 'file_hash': value['fileHash'], + 'data': value['data'], }; } diff --git a/packages/core/src/tonApiV2/models/GetRawConfig200Response.ts b/packages/core/src/tonApiV2/models/GetRawConfig200Response.ts index 8d65556b9..bbd2890e4 100644 --- a/packages/core/src/tonApiV2/models/GetRawConfig200Response.ts +++ b/packages/core/src/tonApiV2/models/GetRawConfig200Response.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { BlockRaw } from './BlockRaw'; import { BlockRawFromJSON, @@ -56,13 +56,11 @@ export interface GetRawConfig200Response { * Check if a given object implements the GetRawConfig200Response interface. */ export function instanceOfGetRawConfig200Response(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "mode" in value; - isInstance = isInstance && "id" in value; - isInstance = isInstance && "stateProof" in value; - isInstance = isInstance && "configProof" in value; - - return isInstance; + if (!('mode' in value)) return false; + if (!('id' in value)) return false; + if (!('stateProof' in value)) return false; + if (!('configProof' in value)) return false; + return true; } export function GetRawConfig200ResponseFromJSON(json: any): GetRawConfig200Response { @@ -70,7 +68,7 @@ export function GetRawConfig200ResponseFromJSON(json: any): GetRawConfig200Respo } export function GetRawConfig200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): GetRawConfig200Response { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -83,18 +81,15 @@ export function GetRawConfig200ResponseFromJSONTyped(json: any, ignoreDiscrimina } export function GetRawConfig200ResponseToJSON(value?: GetRawConfig200Response | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'mode': value.mode, - 'id': BlockRawToJSON(value.id), - 'state_proof': value.stateProof, - 'config_proof': value.configProof, + 'mode': value['mode'], + 'id': BlockRawToJSON(value['id']), + 'state_proof': value['stateProof'], + 'config_proof': value['configProof'], }; } diff --git a/packages/core/src/tonApiV2/models/GetRawListBlockTransactions200Response.ts b/packages/core/src/tonApiV2/models/GetRawListBlockTransactions200Response.ts index 224b832a3..bbe219069 100644 --- a/packages/core/src/tonApiV2/models/GetRawListBlockTransactions200Response.ts +++ b/packages/core/src/tonApiV2/models/GetRawListBlockTransactions200Response.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { BlockRaw } from './BlockRaw'; import { BlockRawFromJSON, @@ -68,14 +68,12 @@ export interface GetRawListBlockTransactions200Response { * Check if a given object implements the GetRawListBlockTransactions200Response interface. */ export function instanceOfGetRawListBlockTransactions200Response(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "id" in value; - isInstance = isInstance && "reqCount" in value; - isInstance = isInstance && "incomplete" in value; - isInstance = isInstance && "ids" in value; - isInstance = isInstance && "proof" in value; - - return isInstance; + if (!('id' in value)) return false; + if (!('reqCount' in value)) return false; + if (!('incomplete' in value)) return false; + if (!('ids' in value)) return false; + if (!('proof' in value)) return false; + return true; } export function GetRawListBlockTransactions200ResponseFromJSON(json: any): GetRawListBlockTransactions200Response { @@ -83,7 +81,7 @@ export function GetRawListBlockTransactions200ResponseFromJSON(json: any): GetRa } export function GetRawListBlockTransactions200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): GetRawListBlockTransactions200Response { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -97,19 +95,16 @@ export function GetRawListBlockTransactions200ResponseFromJSONTyped(json: any, i } export function GetRawListBlockTransactions200ResponseToJSON(value?: GetRawListBlockTransactions200Response | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'id': BlockRawToJSON(value.id), - 'req_count': value.reqCount, - 'incomplete': value.incomplete, - 'ids': ((value.ids as Array).map(GetRawListBlockTransactions200ResponseIdsInnerToJSON)), - 'proof': value.proof, + 'id': BlockRawToJSON(value['id']), + 'req_count': value['reqCount'], + 'incomplete': value['incomplete'], + 'ids': ((value['ids'] as Array).map(GetRawListBlockTransactions200ResponseIdsInnerToJSON)), + 'proof': value['proof'], }; } diff --git a/packages/core/src/tonApiV2/models/GetRawListBlockTransactions200ResponseIdsInner.ts b/packages/core/src/tonApiV2/models/GetRawListBlockTransactions200ResponseIdsInner.ts index 3f48d2047..9d34c5ebb 100644 --- a/packages/core/src/tonApiV2/models/GetRawListBlockTransactions200ResponseIdsInner.ts +++ b/packages/core/src/tonApiV2/models/GetRawListBlockTransactions200ResponseIdsInner.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -49,10 +49,8 @@ export interface GetRawListBlockTransactions200ResponseIdsInner { * Check if a given object implements the GetRawListBlockTransactions200ResponseIdsInner interface. */ export function instanceOfGetRawListBlockTransactions200ResponseIdsInner(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "mode" in value; - - return isInstance; + if (!('mode' in value)) return false; + return true; } export function GetRawListBlockTransactions200ResponseIdsInnerFromJSON(json: any): GetRawListBlockTransactions200ResponseIdsInner { @@ -60,31 +58,28 @@ export function GetRawListBlockTransactions200ResponseIdsInnerFromJSON(json: any } export function GetRawListBlockTransactions200ResponseIdsInnerFromJSONTyped(json: any, ignoreDiscriminator: boolean): GetRawListBlockTransactions200ResponseIdsInner { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'mode': json['mode'], - 'account': !exists(json, 'account') ? undefined : json['account'], - 'lt': !exists(json, 'lt') ? undefined : json['lt'], - 'hash': !exists(json, 'hash') ? undefined : json['hash'], + 'account': json['account'] == null ? undefined : json['account'], + 'lt': json['lt'] == null ? undefined : json['lt'], + 'hash': json['hash'] == null ? undefined : json['hash'], }; } export function GetRawListBlockTransactions200ResponseIdsInnerToJSON(value?: GetRawListBlockTransactions200ResponseIdsInner | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'mode': value.mode, - 'account': value.account, - 'lt': value.lt, - 'hash': value.hash, + 'mode': value['mode'], + 'account': value['account'], + 'lt': value['lt'], + 'hash': value['hash'], }; } diff --git a/packages/core/src/tonApiV2/models/GetRawMasterchainInfo200Response.ts b/packages/core/src/tonApiV2/models/GetRawMasterchainInfo200Response.ts index 5fac0eca2..ae1be9557 100644 --- a/packages/core/src/tonApiV2/models/GetRawMasterchainInfo200Response.ts +++ b/packages/core/src/tonApiV2/models/GetRawMasterchainInfo200Response.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { BlockRaw } from './BlockRaw'; import { BlockRawFromJSON, @@ -56,12 +56,10 @@ export interface GetRawMasterchainInfo200Response { * Check if a given object implements the GetRawMasterchainInfo200Response interface. */ export function instanceOfGetRawMasterchainInfo200Response(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "last" in value; - isInstance = isInstance && "stateRootHash" in value; - isInstance = isInstance && "init" in value; - - return isInstance; + if (!('last' in value)) return false; + if (!('stateRootHash' in value)) return false; + if (!('init' in value)) return false; + return true; } export function GetRawMasterchainInfo200ResponseFromJSON(json: any): GetRawMasterchainInfo200Response { @@ -69,7 +67,7 @@ export function GetRawMasterchainInfo200ResponseFromJSON(json: any): GetRawMaste } export function GetRawMasterchainInfo200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): GetRawMasterchainInfo200Response { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -81,17 +79,14 @@ export function GetRawMasterchainInfo200ResponseFromJSONTyped(json: any, ignoreD } export function GetRawMasterchainInfo200ResponseToJSON(value?: GetRawMasterchainInfo200Response | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'last': BlockRawToJSON(value.last), - 'state_root_hash': value.stateRootHash, - 'init': InitStateRawToJSON(value.init), + 'last': BlockRawToJSON(value['last']), + 'state_root_hash': value['stateRootHash'], + 'init': InitStateRawToJSON(value['init']), }; } diff --git a/packages/core/src/tonApiV2/models/GetRawMasterchainInfoExt200Response.ts b/packages/core/src/tonApiV2/models/GetRawMasterchainInfoExt200Response.ts index b864fe0e5..e9443e3dc 100644 --- a/packages/core/src/tonApiV2/models/GetRawMasterchainInfoExt200Response.ts +++ b/packages/core/src/tonApiV2/models/GetRawMasterchainInfoExt200Response.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { BlockRaw } from './BlockRaw'; import { BlockRawFromJSON, @@ -86,17 +86,15 @@ export interface GetRawMasterchainInfoExt200Response { * Check if a given object implements the GetRawMasterchainInfoExt200Response interface. */ export function instanceOfGetRawMasterchainInfoExt200Response(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "mode" in value; - isInstance = isInstance && "version" in value; - isInstance = isInstance && "capabilities" in value; - isInstance = isInstance && "last" in value; - isInstance = isInstance && "lastUtime" in value; - isInstance = isInstance && "now" in value; - isInstance = isInstance && "stateRootHash" in value; - isInstance = isInstance && "init" in value; - - return isInstance; + if (!('mode' in value)) return false; + if (!('version' in value)) return false; + if (!('capabilities' in value)) return false; + if (!('last' in value)) return false; + if (!('lastUtime' in value)) return false; + if (!('now' in value)) return false; + if (!('stateRootHash' in value)) return false; + if (!('init' in value)) return false; + return true; } export function GetRawMasterchainInfoExt200ResponseFromJSON(json: any): GetRawMasterchainInfoExt200Response { @@ -104,7 +102,7 @@ export function GetRawMasterchainInfoExt200ResponseFromJSON(json: any): GetRawMa } export function GetRawMasterchainInfoExt200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): GetRawMasterchainInfoExt200Response { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -121,22 +119,19 @@ export function GetRawMasterchainInfoExt200ResponseFromJSONTyped(json: any, igno } export function GetRawMasterchainInfoExt200ResponseToJSON(value?: GetRawMasterchainInfoExt200Response | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'mode': value.mode, - 'version': value.version, - 'capabilities': value.capabilities, - 'last': BlockRawToJSON(value.last), - 'last_utime': value.lastUtime, - 'now': value.now, - 'state_root_hash': value.stateRootHash, - 'init': InitStateRawToJSON(value.init), + 'mode': value['mode'], + 'version': value['version'], + 'capabilities': value['capabilities'], + 'last': BlockRawToJSON(value['last']), + 'last_utime': value['lastUtime'], + 'now': value['now'], + 'state_root_hash': value['stateRootHash'], + 'init': InitStateRawToJSON(value['init']), }; } diff --git a/packages/core/src/tonApiV2/models/GetRawShardBlockProof200Response.ts b/packages/core/src/tonApiV2/models/GetRawShardBlockProof200Response.ts index 8c11aea10..6f1f25002 100644 --- a/packages/core/src/tonApiV2/models/GetRawShardBlockProof200Response.ts +++ b/packages/core/src/tonApiV2/models/GetRawShardBlockProof200Response.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { BlockRaw } from './BlockRaw'; import { BlockRawFromJSON, @@ -50,11 +50,9 @@ export interface GetRawShardBlockProof200Response { * Check if a given object implements the GetRawShardBlockProof200Response interface. */ export function instanceOfGetRawShardBlockProof200Response(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "masterchainId" in value; - isInstance = isInstance && "links" in value; - - return isInstance; + if (!('masterchainId' in value)) return false; + if (!('links' in value)) return false; + return true; } export function GetRawShardBlockProof200ResponseFromJSON(json: any): GetRawShardBlockProof200Response { @@ -62,7 +60,7 @@ export function GetRawShardBlockProof200ResponseFromJSON(json: any): GetRawShard } export function GetRawShardBlockProof200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): GetRawShardBlockProof200Response { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -73,16 +71,13 @@ export function GetRawShardBlockProof200ResponseFromJSONTyped(json: any, ignoreD } export function GetRawShardBlockProof200ResponseToJSON(value?: GetRawShardBlockProof200Response | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'masterchain_id': BlockRawToJSON(value.masterchainId), - 'links': ((value.links as Array).map(GetRawShardBlockProof200ResponseLinksInnerToJSON)), + 'masterchain_id': BlockRawToJSON(value['masterchainId']), + 'links': ((value['links'] as Array).map(GetRawShardBlockProof200ResponseLinksInnerToJSON)), }; } diff --git a/packages/core/src/tonApiV2/models/GetRawShardBlockProof200ResponseLinksInner.ts b/packages/core/src/tonApiV2/models/GetRawShardBlockProof200ResponseLinksInner.ts index d1588701f..39faa3dc1 100644 --- a/packages/core/src/tonApiV2/models/GetRawShardBlockProof200ResponseLinksInner.ts +++ b/packages/core/src/tonApiV2/models/GetRawShardBlockProof200ResponseLinksInner.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { BlockRaw } from './BlockRaw'; import { BlockRawFromJSON, @@ -44,11 +44,9 @@ export interface GetRawShardBlockProof200ResponseLinksInner { * Check if a given object implements the GetRawShardBlockProof200ResponseLinksInner interface. */ export function instanceOfGetRawShardBlockProof200ResponseLinksInner(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "id" in value; - isInstance = isInstance && "proof" in value; - - return isInstance; + if (!('id' in value)) return false; + if (!('proof' in value)) return false; + return true; } export function GetRawShardBlockProof200ResponseLinksInnerFromJSON(json: any): GetRawShardBlockProof200ResponseLinksInner { @@ -56,7 +54,7 @@ export function GetRawShardBlockProof200ResponseLinksInnerFromJSON(json: any): G } export function GetRawShardBlockProof200ResponseLinksInnerFromJSONTyped(json: any, ignoreDiscriminator: boolean): GetRawShardBlockProof200ResponseLinksInner { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -67,16 +65,13 @@ export function GetRawShardBlockProof200ResponseLinksInnerFromJSONTyped(json: an } export function GetRawShardBlockProof200ResponseLinksInnerToJSON(value?: GetRawShardBlockProof200ResponseLinksInner | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'id': BlockRawToJSON(value.id), - 'proof': value.proof, + 'id': BlockRawToJSON(value['id']), + 'proof': value['proof'], }; } diff --git a/packages/core/src/tonApiV2/models/GetRawShardInfo200Response.ts b/packages/core/src/tonApiV2/models/GetRawShardInfo200Response.ts index 0b1c29f22..00ac9311c 100644 --- a/packages/core/src/tonApiV2/models/GetRawShardInfo200Response.ts +++ b/packages/core/src/tonApiV2/models/GetRawShardInfo200Response.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { BlockRaw } from './BlockRaw'; import { BlockRawFromJSON, @@ -56,13 +56,11 @@ export interface GetRawShardInfo200Response { * Check if a given object implements the GetRawShardInfo200Response interface. */ export function instanceOfGetRawShardInfo200Response(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "id" in value; - isInstance = isInstance && "shardblk" in value; - isInstance = isInstance && "shardProof" in value; - isInstance = isInstance && "shardDescr" in value; - - return isInstance; + if (!('id' in value)) return false; + if (!('shardblk' in value)) return false; + if (!('shardProof' in value)) return false; + if (!('shardDescr' in value)) return false; + return true; } export function GetRawShardInfo200ResponseFromJSON(json: any): GetRawShardInfo200Response { @@ -70,7 +68,7 @@ export function GetRawShardInfo200ResponseFromJSON(json: any): GetRawShardInfo20 } export function GetRawShardInfo200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): GetRawShardInfo200Response { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -83,18 +81,15 @@ export function GetRawShardInfo200ResponseFromJSONTyped(json: any, ignoreDiscrim } export function GetRawShardInfo200ResponseToJSON(value?: GetRawShardInfo200Response | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'id': BlockRawToJSON(value.id), - 'shardblk': BlockRawToJSON(value.shardblk), - 'shard_proof': value.shardProof, - 'shard_descr': value.shardDescr, + 'id': BlockRawToJSON(value['id']), + 'shardblk': BlockRawToJSON(value['shardblk']), + 'shard_proof': value['shardProof'], + 'shard_descr': value['shardDescr'], }; } diff --git a/packages/core/src/tonApiV2/models/GetRawTime200Response.ts b/packages/core/src/tonApiV2/models/GetRawTime200Response.ts index 35b29003d..6df4144bf 100644 --- a/packages/core/src/tonApiV2/models/GetRawTime200Response.ts +++ b/packages/core/src/tonApiV2/models/GetRawTime200Response.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -31,10 +31,8 @@ export interface GetRawTime200Response { * Check if a given object implements the GetRawTime200Response interface. */ export function instanceOfGetRawTime200Response(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "time" in value; - - return isInstance; + if (!('time' in value)) return false; + return true; } export function GetRawTime200ResponseFromJSON(json: any): GetRawTime200Response { @@ -42,7 +40,7 @@ export function GetRawTime200ResponseFromJSON(json: any): GetRawTime200Response } export function GetRawTime200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): GetRawTime200Response { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -52,15 +50,12 @@ export function GetRawTime200ResponseFromJSONTyped(json: any, ignoreDiscriminato } export function GetRawTime200ResponseToJSON(value?: GetRawTime200Response | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'time': value.time, + 'time': value['time'], }; } diff --git a/packages/core/src/tonApiV2/models/GetRawTransactions200Response.ts b/packages/core/src/tonApiV2/models/GetRawTransactions200Response.ts index e2a8f969d..668bb0907 100644 --- a/packages/core/src/tonApiV2/models/GetRawTransactions200Response.ts +++ b/packages/core/src/tonApiV2/models/GetRawTransactions200Response.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { BlockRaw } from './BlockRaw'; import { BlockRawFromJSON, @@ -44,11 +44,9 @@ export interface GetRawTransactions200Response { * Check if a given object implements the GetRawTransactions200Response interface. */ export function instanceOfGetRawTransactions200Response(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "ids" in value; - isInstance = isInstance && "transactions" in value; - - return isInstance; + if (!('ids' in value)) return false; + if (!('transactions' in value)) return false; + return true; } export function GetRawTransactions200ResponseFromJSON(json: any): GetRawTransactions200Response { @@ -56,7 +54,7 @@ export function GetRawTransactions200ResponseFromJSON(json: any): GetRawTransact } export function GetRawTransactions200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): GetRawTransactions200Response { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -67,16 +65,13 @@ export function GetRawTransactions200ResponseFromJSONTyped(json: any, ignoreDisc } export function GetRawTransactions200ResponseToJSON(value?: GetRawTransactions200Response | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'ids': ((value.ids as Array).map(BlockRawToJSON)), - 'transactions': value.transactions, + 'ids': ((value['ids'] as Array).map(BlockRawToJSON)), + 'transactions': value['transactions'], }; } diff --git a/packages/core/src/tonApiV2/models/GetStakingPoolHistory200Response.ts b/packages/core/src/tonApiV2/models/GetStakingPoolHistory200Response.ts index 2a501daa6..9467c4762 100644 --- a/packages/core/src/tonApiV2/models/GetStakingPoolHistory200Response.ts +++ b/packages/core/src/tonApiV2/models/GetStakingPoolHistory200Response.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { ApyHistory } from './ApyHistory'; import { ApyHistoryFromJSON, @@ -38,10 +38,8 @@ export interface GetStakingPoolHistory200Response { * Check if a given object implements the GetStakingPoolHistory200Response interface. */ export function instanceOfGetStakingPoolHistory200Response(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "apy" in value; - - return isInstance; + if (!('apy' in value)) return false; + return true; } export function GetStakingPoolHistory200ResponseFromJSON(json: any): GetStakingPoolHistory200Response { @@ -49,7 +47,7 @@ export function GetStakingPoolHistory200ResponseFromJSON(json: any): GetStakingP } export function GetStakingPoolHistory200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): GetStakingPoolHistory200Response { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -59,15 +57,12 @@ export function GetStakingPoolHistory200ResponseFromJSONTyped(json: any, ignoreD } export function GetStakingPoolHistory200ResponseToJSON(value?: GetStakingPoolHistory200Response | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'apy': ((value.apy as Array).map(ApyHistoryToJSON)), + 'apy': ((value['apy'] as Array).map(ApyHistoryToJSON)), }; } diff --git a/packages/core/src/tonApiV2/models/GetStakingPoolInfo200Response.ts b/packages/core/src/tonApiV2/models/GetStakingPoolInfo200Response.ts index 835961d81..e44078794 100644 --- a/packages/core/src/tonApiV2/models/GetStakingPoolInfo200Response.ts +++ b/packages/core/src/tonApiV2/models/GetStakingPoolInfo200Response.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { PoolImplementation } from './PoolImplementation'; import { PoolImplementationFromJSON, @@ -50,11 +50,9 @@ export interface GetStakingPoolInfo200Response { * Check if a given object implements the GetStakingPoolInfo200Response interface. */ export function instanceOfGetStakingPoolInfo200Response(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "implementation" in value; - isInstance = isInstance && "pool" in value; - - return isInstance; + if (!('implementation' in value)) return false; + if (!('pool' in value)) return false; + return true; } export function GetStakingPoolInfo200ResponseFromJSON(json: any): GetStakingPoolInfo200Response { @@ -62,7 +60,7 @@ export function GetStakingPoolInfo200ResponseFromJSON(json: any): GetStakingPool } export function GetStakingPoolInfo200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): GetStakingPoolInfo200Response { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -73,16 +71,13 @@ export function GetStakingPoolInfo200ResponseFromJSONTyped(json: any, ignoreDisc } export function GetStakingPoolInfo200ResponseToJSON(value?: GetStakingPoolInfo200Response | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'implementation': PoolImplementationToJSON(value.implementation), - 'pool': PoolInfoToJSON(value.pool), + 'implementation': PoolImplementationToJSON(value['implementation']), + 'pool': PoolInfoToJSON(value['pool']), }; } diff --git a/packages/core/src/tonApiV2/models/GetStakingPools200Response.ts b/packages/core/src/tonApiV2/models/GetStakingPools200Response.ts index 8fbad6d9f..4e07ff907 100644 --- a/packages/core/src/tonApiV2/models/GetStakingPools200Response.ts +++ b/packages/core/src/tonApiV2/models/GetStakingPools200Response.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { PoolImplementation } from './PoolImplementation'; import { PoolImplementationFromJSON, @@ -50,11 +50,9 @@ export interface GetStakingPools200Response { * Check if a given object implements the GetStakingPools200Response interface. */ export function instanceOfGetStakingPools200Response(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "pools" in value; - isInstance = isInstance && "implementations" in value; - - return isInstance; + if (!('pools' in value)) return false; + if (!('implementations' in value)) return false; + return true; } export function GetStakingPools200ResponseFromJSON(json: any): GetStakingPools200Response { @@ -62,7 +60,7 @@ export function GetStakingPools200ResponseFromJSON(json: any): GetStakingPools20 } export function GetStakingPools200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): GetStakingPools200Response { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -73,16 +71,13 @@ export function GetStakingPools200ResponseFromJSONTyped(json: any, ignoreDiscrim } export function GetStakingPools200ResponseToJSON(value?: GetStakingPools200Response | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'pools': ((value.pools as Array).map(PoolInfoToJSON)), - 'implementations': (mapValues(value.implementations, PoolImplementationToJSON)), + 'pools': ((value['pools'] as Array).map(PoolInfoToJSON)), + 'implementations': (mapValues(value['implementations'], PoolImplementationToJSON)), }; } diff --git a/packages/core/src/tonApiV2/models/GetStorageProviders200Response.ts b/packages/core/src/tonApiV2/models/GetStorageProviders200Response.ts index 2ae9a4a9f..888a5a492 100644 --- a/packages/core/src/tonApiV2/models/GetStorageProviders200Response.ts +++ b/packages/core/src/tonApiV2/models/GetStorageProviders200Response.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { StorageProvider } from './StorageProvider'; import { StorageProviderFromJSON, @@ -38,10 +38,8 @@ export interface GetStorageProviders200Response { * Check if a given object implements the GetStorageProviders200Response interface. */ export function instanceOfGetStorageProviders200Response(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "providers" in value; - - return isInstance; + if (!('providers' in value)) return false; + return true; } export function GetStorageProviders200ResponseFromJSON(json: any): GetStorageProviders200Response { @@ -49,7 +47,7 @@ export function GetStorageProviders200ResponseFromJSON(json: any): GetStoragePro } export function GetStorageProviders200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): GetStorageProviders200Response { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -59,15 +57,12 @@ export function GetStorageProviders200ResponseFromJSONTyped(json: any, ignoreDis } export function GetStorageProviders200ResponseToJSON(value?: GetStorageProviders200Response | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'providers': ((value.providers as Array).map(StorageProviderToJSON)), + 'providers': ((value['providers'] as Array).map(StorageProviderToJSON)), }; } diff --git a/packages/core/src/tonApiV2/models/GetTonConnectPayload200Response.ts b/packages/core/src/tonApiV2/models/GetTonConnectPayload200Response.ts index 175cda755..750a2b129 100644 --- a/packages/core/src/tonApiV2/models/GetTonConnectPayload200Response.ts +++ b/packages/core/src/tonApiV2/models/GetTonConnectPayload200Response.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -31,10 +31,8 @@ export interface GetTonConnectPayload200Response { * Check if a given object implements the GetTonConnectPayload200Response interface. */ export function instanceOfGetTonConnectPayload200Response(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "payload" in value; - - return isInstance; + if (!('payload' in value)) return false; + return true; } export function GetTonConnectPayload200ResponseFromJSON(json: any): GetTonConnectPayload200Response { @@ -42,7 +40,7 @@ export function GetTonConnectPayload200ResponseFromJSON(json: any): GetTonConnec } export function GetTonConnectPayload200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): GetTonConnectPayload200Response { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -52,15 +50,12 @@ export function GetTonConnectPayload200ResponseFromJSONTyped(json: any, ignoreDi } export function GetTonConnectPayload200ResponseToJSON(value?: GetTonConnectPayload200Response | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'payload': value.payload, + 'payload': value['payload'], }; } diff --git a/packages/core/src/tonApiV2/models/GetWalletBackup200Response.ts b/packages/core/src/tonApiV2/models/GetWalletBackup200Response.ts index 7ff35443d..6e20b8130 100644 --- a/packages/core/src/tonApiV2/models/GetWalletBackup200Response.ts +++ b/packages/core/src/tonApiV2/models/GetWalletBackup200Response.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -31,10 +31,8 @@ export interface GetWalletBackup200Response { * Check if a given object implements the GetWalletBackup200Response interface. */ export function instanceOfGetWalletBackup200Response(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "dump" in value; - - return isInstance; + if (!('dump' in value)) return false; + return true; } export function GetWalletBackup200ResponseFromJSON(json: any): GetWalletBackup200Response { @@ -42,7 +40,7 @@ export function GetWalletBackup200ResponseFromJSON(json: any): GetWalletBackup20 } export function GetWalletBackup200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): GetWalletBackup200Response { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -52,15 +50,12 @@ export function GetWalletBackup200ResponseFromJSONTyped(json: any, ignoreDiscrim } export function GetWalletBackup200ResponseToJSON(value?: GetWalletBackup200Response | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'dump': value.dump, + 'dump': value['dump'], }; } diff --git a/packages/core/src/tonApiV2/models/ImagePreview.ts b/packages/core/src/tonApiV2/models/ImagePreview.ts index 0336a9ddc..d83fe6f7e 100644 --- a/packages/core/src/tonApiV2/models/ImagePreview.ts +++ b/packages/core/src/tonApiV2/models/ImagePreview.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -37,11 +37,9 @@ export interface ImagePreview { * Check if a given object implements the ImagePreview interface. */ export function instanceOfImagePreview(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "resolution" in value; - isInstance = isInstance && "url" in value; - - return isInstance; + if (!('resolution' in value)) return false; + if (!('url' in value)) return false; + return true; } export function ImagePreviewFromJSON(json: any): ImagePreview { @@ -49,7 +47,7 @@ export function ImagePreviewFromJSON(json: any): ImagePreview { } export function ImagePreviewFromJSONTyped(json: any, ignoreDiscriminator: boolean): ImagePreview { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -60,16 +58,13 @@ export function ImagePreviewFromJSONTyped(json: any, ignoreDiscriminator: boolea } export function ImagePreviewToJSON(value?: ImagePreview | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'resolution': value.resolution, - 'url': value.url, + 'resolution': value['resolution'], + 'url': value['url'], }; } diff --git a/packages/core/src/tonApiV2/models/InitStateRaw.ts b/packages/core/src/tonApiV2/models/InitStateRaw.ts index 5618d5711..737cbfabc 100644 --- a/packages/core/src/tonApiV2/models/InitStateRaw.ts +++ b/packages/core/src/tonApiV2/models/InitStateRaw.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -43,12 +43,10 @@ export interface InitStateRaw { * Check if a given object implements the InitStateRaw interface. */ export function instanceOfInitStateRaw(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "workchain" in value; - isInstance = isInstance && "rootHash" in value; - isInstance = isInstance && "fileHash" in value; - - return isInstance; + if (!('workchain' in value)) return false; + if (!('rootHash' in value)) return false; + if (!('fileHash' in value)) return false; + return true; } export function InitStateRawFromJSON(json: any): InitStateRaw { @@ -56,7 +54,7 @@ export function InitStateRawFromJSON(json: any): InitStateRaw { } export function InitStateRawFromJSONTyped(json: any, ignoreDiscriminator: boolean): InitStateRaw { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -68,17 +66,14 @@ export function InitStateRawFromJSONTyped(json: any, ignoreDiscriminator: boolea } export function InitStateRawToJSON(value?: InitStateRaw | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'workchain': value.workchain, - 'root_hash': value.rootHash, - 'file_hash': value.fileHash, + 'workchain': value['workchain'], + 'root_hash': value['rootHash'], + 'file_hash': value['fileHash'], }; } diff --git a/packages/core/src/tonApiV2/models/InscriptionBalance.ts b/packages/core/src/tonApiV2/models/InscriptionBalance.ts index 0bbe9c23b..cbcabb3ed 100644 --- a/packages/core/src/tonApiV2/models/InscriptionBalance.ts +++ b/packages/core/src/tonApiV2/models/InscriptionBalance.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -60,13 +60,11 @@ export type InscriptionBalanceTypeEnum = typeof InscriptionBalanceTypeEnum[keyof * Check if a given object implements the InscriptionBalance interface. */ export function instanceOfInscriptionBalance(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "type" in value; - isInstance = isInstance && "ticker" in value; - isInstance = isInstance && "balance" in value; - isInstance = isInstance && "decimals" in value; - - return isInstance; + if (!('type' in value)) return false; + if (!('ticker' in value)) return false; + if (!('balance' in value)) return false; + if (!('decimals' in value)) return false; + return true; } export function InscriptionBalanceFromJSON(json: any): InscriptionBalance { @@ -74,7 +72,7 @@ export function InscriptionBalanceFromJSON(json: any): InscriptionBalance { } export function InscriptionBalanceFromJSONTyped(json: any, ignoreDiscriminator: boolean): InscriptionBalance { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -87,18 +85,15 @@ export function InscriptionBalanceFromJSONTyped(json: any, ignoreDiscriminator: } export function InscriptionBalanceToJSON(value?: InscriptionBalance | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'type': value.type, - 'ticker': value.ticker, - 'balance': value.balance, - 'decimals': value.decimals, + 'type': value['type'], + 'ticker': value['ticker'], + 'balance': value['balance'], + 'decimals': value['decimals'], }; } diff --git a/packages/core/src/tonApiV2/models/InscriptionBalances.ts b/packages/core/src/tonApiV2/models/InscriptionBalances.ts index fde068fe0..77894c47c 100644 --- a/packages/core/src/tonApiV2/models/InscriptionBalances.ts +++ b/packages/core/src/tonApiV2/models/InscriptionBalances.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { InscriptionBalance } from './InscriptionBalance'; import { InscriptionBalanceFromJSON, @@ -38,10 +38,8 @@ export interface InscriptionBalances { * Check if a given object implements the InscriptionBalances interface. */ export function instanceOfInscriptionBalances(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "inscriptions" in value; - - return isInstance; + if (!('inscriptions' in value)) return false; + return true; } export function InscriptionBalancesFromJSON(json: any): InscriptionBalances { @@ -49,7 +47,7 @@ export function InscriptionBalancesFromJSON(json: any): InscriptionBalances { } export function InscriptionBalancesFromJSONTyped(json: any, ignoreDiscriminator: boolean): InscriptionBalances { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -59,15 +57,12 @@ export function InscriptionBalancesFromJSONTyped(json: any, ignoreDiscriminator: } export function InscriptionBalancesToJSON(value?: InscriptionBalances | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'inscriptions': ((value.inscriptions as Array).map(InscriptionBalanceToJSON)), + 'inscriptions': ((value['inscriptions'] as Array).map(InscriptionBalanceToJSON)), }; } diff --git a/packages/core/src/tonApiV2/models/InscriptionMintAction.ts b/packages/core/src/tonApiV2/models/InscriptionMintAction.ts index 6b5e6bb0e..514a462b9 100644 --- a/packages/core/src/tonApiV2/models/InscriptionMintAction.ts +++ b/packages/core/src/tonApiV2/models/InscriptionMintAction.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { AccountAddress } from './AccountAddress'; import { AccountAddressFromJSON, @@ -73,14 +73,12 @@ export type InscriptionMintActionTypeEnum = typeof InscriptionMintActionTypeEnum * Check if a given object implements the InscriptionMintAction interface. */ export function instanceOfInscriptionMintAction(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "recipient" in value; - isInstance = isInstance && "amount" in value; - isInstance = isInstance && "type" in value; - isInstance = isInstance && "ticker" in value; - isInstance = isInstance && "decimals" in value; - - return isInstance; + if (!('recipient' in value)) return false; + if (!('amount' in value)) return false; + if (!('type' in value)) return false; + if (!('ticker' in value)) return false; + if (!('decimals' in value)) return false; + return true; } export function InscriptionMintActionFromJSON(json: any): InscriptionMintAction { @@ -88,7 +86,7 @@ export function InscriptionMintActionFromJSON(json: any): InscriptionMintAction } export function InscriptionMintActionFromJSONTyped(json: any, ignoreDiscriminator: boolean): InscriptionMintAction { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -102,19 +100,16 @@ export function InscriptionMintActionFromJSONTyped(json: any, ignoreDiscriminato } export function InscriptionMintActionToJSON(value?: InscriptionMintAction | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'recipient': AccountAddressToJSON(value.recipient), - 'amount': value.amount, - 'type': value.type, - 'ticker': value.ticker, - 'decimals': value.decimals, + 'recipient': AccountAddressToJSON(value['recipient']), + 'amount': value['amount'], + 'type': value['type'], + 'ticker': value['ticker'], + 'decimals': value['decimals'], }; } diff --git a/packages/core/src/tonApiV2/models/InscriptionTransferAction.ts b/packages/core/src/tonApiV2/models/InscriptionTransferAction.ts index 442ff01c2..138af1c4c 100644 --- a/packages/core/src/tonApiV2/models/InscriptionTransferAction.ts +++ b/packages/core/src/tonApiV2/models/InscriptionTransferAction.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { AccountAddress } from './AccountAddress'; import { AccountAddressFromJSON, @@ -85,15 +85,13 @@ export type InscriptionTransferActionTypeEnum = typeof InscriptionTransferAction * Check if a given object implements the InscriptionTransferAction interface. */ export function instanceOfInscriptionTransferAction(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "sender" in value; - isInstance = isInstance && "recipient" in value; - isInstance = isInstance && "amount" in value; - isInstance = isInstance && "type" in value; - isInstance = isInstance && "ticker" in value; - isInstance = isInstance && "decimals" in value; - - return isInstance; + if (!('sender' in value)) return false; + if (!('recipient' in value)) return false; + if (!('amount' in value)) return false; + if (!('type' in value)) return false; + if (!('ticker' in value)) return false; + if (!('decimals' in value)) return false; + return true; } export function InscriptionTransferActionFromJSON(json: any): InscriptionTransferAction { @@ -101,7 +99,7 @@ export function InscriptionTransferActionFromJSON(json: any): InscriptionTransfe } export function InscriptionTransferActionFromJSONTyped(json: any, ignoreDiscriminator: boolean): InscriptionTransferAction { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -109,7 +107,7 @@ export function InscriptionTransferActionFromJSONTyped(json: any, ignoreDiscrimi 'sender': AccountAddressFromJSON(json['sender']), 'recipient': AccountAddressFromJSON(json['recipient']), 'amount': json['amount'], - 'comment': !exists(json, 'comment') ? undefined : json['comment'], + 'comment': json['comment'] == null ? undefined : json['comment'], 'type': json['type'], 'ticker': json['ticker'], 'decimals': json['decimals'], @@ -117,21 +115,18 @@ export function InscriptionTransferActionFromJSONTyped(json: any, ignoreDiscrimi } export function InscriptionTransferActionToJSON(value?: InscriptionTransferAction | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'sender': AccountAddressToJSON(value.sender), - 'recipient': AccountAddressToJSON(value.recipient), - 'amount': value.amount, - 'comment': value.comment, - 'type': value.type, - 'ticker': value.ticker, - 'decimals': value.decimals, + 'sender': AccountAddressToJSON(value['sender']), + 'recipient': AccountAddressToJSON(value['recipient']), + 'amount': value['amount'], + 'comment': value['comment'], + 'type': value['type'], + 'ticker': value['ticker'], + 'decimals': value['decimals'], }; } diff --git a/packages/core/src/tonApiV2/models/JettonBalance.ts b/packages/core/src/tonApiV2/models/JettonBalance.ts index ee7d8d6a4..181bfd47c 100644 --- a/packages/core/src/tonApiV2/models/JettonBalance.ts +++ b/packages/core/src/tonApiV2/models/JettonBalance.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { AccountAddress } from './AccountAddress'; import { AccountAddressFromJSON, @@ -68,12 +68,10 @@ export interface JettonBalance { * Check if a given object implements the JettonBalance interface. */ export function instanceOfJettonBalance(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "balance" in value; - isInstance = isInstance && "walletAddress" in value; - isInstance = isInstance && "jetton" in value; - - return isInstance; + if (!('balance' in value)) return false; + if (!('walletAddress' in value)) return false; + if (!('jetton' in value)) return false; + return true; } export function JettonBalanceFromJSON(json: any): JettonBalance { @@ -81,31 +79,28 @@ export function JettonBalanceFromJSON(json: any): JettonBalance { } export function JettonBalanceFromJSONTyped(json: any, ignoreDiscriminator: boolean): JettonBalance { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'balance': json['balance'], - 'price': !exists(json, 'price') ? undefined : TokenRatesFromJSON(json['price']), + 'price': json['price'] == null ? undefined : TokenRatesFromJSON(json['price']), 'walletAddress': AccountAddressFromJSON(json['wallet_address']), 'jetton': JettonPreviewFromJSON(json['jetton']), }; } export function JettonBalanceToJSON(value?: JettonBalance | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'balance': value.balance, - 'price': TokenRatesToJSON(value.price), - 'wallet_address': AccountAddressToJSON(value.walletAddress), - 'jetton': JettonPreviewToJSON(value.jetton), + 'balance': value['balance'], + 'price': TokenRatesToJSON(value['price']), + 'wallet_address': AccountAddressToJSON(value['walletAddress']), + 'jetton': JettonPreviewToJSON(value['jetton']), }; } diff --git a/packages/core/src/tonApiV2/models/JettonBridgeParams.ts b/packages/core/src/tonApiV2/models/JettonBridgeParams.ts index a2ed66a03..7e9555153 100644 --- a/packages/core/src/tonApiV2/models/JettonBridgeParams.ts +++ b/packages/core/src/tonApiV2/models/JettonBridgeParams.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { JettonBridgePrices } from './JettonBridgePrices'; import { JettonBridgePricesFromJSON, @@ -80,13 +80,11 @@ export interface JettonBridgeParams { * Check if a given object implements the JettonBridgeParams interface. */ export function instanceOfJettonBridgeParams(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "bridgeAddress" in value; - isInstance = isInstance && "oraclesAddress" in value; - isInstance = isInstance && "stateFlags" in value; - isInstance = isInstance && "oracles" in value; - - return isInstance; + if (!('bridgeAddress' in value)) return false; + if (!('oraclesAddress' in value)) return false; + if (!('stateFlags' in value)) return false; + if (!('oracles' in value)) return false; + return true; } export function JettonBridgeParamsFromJSON(json: any): JettonBridgeParams { @@ -94,7 +92,7 @@ export function JettonBridgeParamsFromJSON(json: any): JettonBridgeParams { } export function JettonBridgeParamsFromJSONTyped(json: any, ignoreDiscriminator: boolean): JettonBridgeParams { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -102,29 +100,26 @@ export function JettonBridgeParamsFromJSONTyped(json: any, ignoreDiscriminator: 'bridgeAddress': json['bridge_address'], 'oraclesAddress': json['oracles_address'], 'stateFlags': json['state_flags'], - 'burnBridgeFee': !exists(json, 'burn_bridge_fee') ? undefined : json['burn_bridge_fee'], + 'burnBridgeFee': json['burn_bridge_fee'] == null ? undefined : json['burn_bridge_fee'], 'oracles': ((json['oracles'] as Array).map(OracleFromJSON)), - 'externalChainAddress': !exists(json, 'external_chain_address') ? undefined : json['external_chain_address'], - 'prices': !exists(json, 'prices') ? undefined : JettonBridgePricesFromJSON(json['prices']), + 'externalChainAddress': json['external_chain_address'] == null ? undefined : json['external_chain_address'], + 'prices': json['prices'] == null ? undefined : JettonBridgePricesFromJSON(json['prices']), }; } export function JettonBridgeParamsToJSON(value?: JettonBridgeParams | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'bridge_address': value.bridgeAddress, - 'oracles_address': value.oraclesAddress, - 'state_flags': value.stateFlags, - 'burn_bridge_fee': value.burnBridgeFee, - 'oracles': ((value.oracles as Array).map(OracleToJSON)), - 'external_chain_address': value.externalChainAddress, - 'prices': JettonBridgePricesToJSON(value.prices), + 'bridge_address': value['bridgeAddress'], + 'oracles_address': value['oraclesAddress'], + 'state_flags': value['stateFlags'], + 'burn_bridge_fee': value['burnBridgeFee'], + 'oracles': ((value['oracles'] as Array).map(OracleToJSON)), + 'external_chain_address': value['externalChainAddress'], + 'prices': JettonBridgePricesToJSON(value['prices']), }; } diff --git a/packages/core/src/tonApiV2/models/JettonBridgePrices.ts b/packages/core/src/tonApiV2/models/JettonBridgePrices.ts index 028a98ec6..990bbba12 100644 --- a/packages/core/src/tonApiV2/models/JettonBridgePrices.ts +++ b/packages/core/src/tonApiV2/models/JettonBridgePrices.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -61,15 +61,13 @@ export interface JettonBridgePrices { * Check if a given object implements the JettonBridgePrices interface. */ export function instanceOfJettonBridgePrices(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "bridgeBurnFee" in value; - isInstance = isInstance && "bridgeMintFee" in value; - isInstance = isInstance && "walletMinTonsForStorage" in value; - isInstance = isInstance && "walletGasConsumption" in value; - isInstance = isInstance && "minterMinTonsForStorage" in value; - isInstance = isInstance && "discoverGasConsumption" in value; - - return isInstance; + if (!('bridgeBurnFee' in value)) return false; + if (!('bridgeMintFee' in value)) return false; + if (!('walletMinTonsForStorage' in value)) return false; + if (!('walletGasConsumption' in value)) return false; + if (!('minterMinTonsForStorage' in value)) return false; + if (!('discoverGasConsumption' in value)) return false; + return true; } export function JettonBridgePricesFromJSON(json: any): JettonBridgePrices { @@ -77,7 +75,7 @@ export function JettonBridgePricesFromJSON(json: any): JettonBridgePrices { } export function JettonBridgePricesFromJSONTyped(json: any, ignoreDiscriminator: boolean): JettonBridgePrices { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -92,20 +90,17 @@ export function JettonBridgePricesFromJSONTyped(json: any, ignoreDiscriminator: } export function JettonBridgePricesToJSON(value?: JettonBridgePrices | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'bridge_burn_fee': value.bridgeBurnFee, - 'bridge_mint_fee': value.bridgeMintFee, - 'wallet_min_tons_for_storage': value.walletMinTonsForStorage, - 'wallet_gas_consumption': value.walletGasConsumption, - 'minter_min_tons_for_storage': value.minterMinTonsForStorage, - 'discover_gas_consumption': value.discoverGasConsumption, + 'bridge_burn_fee': value['bridgeBurnFee'], + 'bridge_mint_fee': value['bridgeMintFee'], + 'wallet_min_tons_for_storage': value['walletMinTonsForStorage'], + 'wallet_gas_consumption': value['walletGasConsumption'], + 'minter_min_tons_for_storage': value['minterMinTonsForStorage'], + 'discover_gas_consumption': value['discoverGasConsumption'], }; } diff --git a/packages/core/src/tonApiV2/models/JettonBurnAction.ts b/packages/core/src/tonApiV2/models/JettonBurnAction.ts index 9d92a0524..a49aa19aa 100644 --- a/packages/core/src/tonApiV2/models/JettonBurnAction.ts +++ b/packages/core/src/tonApiV2/models/JettonBurnAction.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { AccountAddress } from './AccountAddress'; import { AccountAddressFromJSON, @@ -62,13 +62,11 @@ export interface JettonBurnAction { * Check if a given object implements the JettonBurnAction interface. */ export function instanceOfJettonBurnAction(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "sender" in value; - isInstance = isInstance && "sendersWallet" in value; - isInstance = isInstance && "amount" in value; - isInstance = isInstance && "jetton" in value; - - return isInstance; + if (!('sender' in value)) return false; + if (!('sendersWallet' in value)) return false; + if (!('amount' in value)) return false; + if (!('jetton' in value)) return false; + return true; } export function JettonBurnActionFromJSON(json: any): JettonBurnAction { @@ -76,7 +74,7 @@ export function JettonBurnActionFromJSON(json: any): JettonBurnAction { } export function JettonBurnActionFromJSONTyped(json: any, ignoreDiscriminator: boolean): JettonBurnAction { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -89,18 +87,15 @@ export function JettonBurnActionFromJSONTyped(json: any, ignoreDiscriminator: bo } export function JettonBurnActionToJSON(value?: JettonBurnAction | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'sender': AccountAddressToJSON(value.sender), - 'senders_wallet': value.sendersWallet, - 'amount': value.amount, - 'jetton': JettonPreviewToJSON(value.jetton), + 'sender': AccountAddressToJSON(value['sender']), + 'senders_wallet': value['sendersWallet'], + 'amount': value['amount'], + 'jetton': JettonPreviewToJSON(value['jetton']), }; } diff --git a/packages/core/src/tonApiV2/models/JettonHolders.ts b/packages/core/src/tonApiV2/models/JettonHolders.ts index 97ad843c0..636031391 100644 --- a/packages/core/src/tonApiV2/models/JettonHolders.ts +++ b/packages/core/src/tonApiV2/models/JettonHolders.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { JettonHoldersAddressesInner } from './JettonHoldersAddressesInner'; import { JettonHoldersAddressesInnerFromJSON, @@ -38,10 +38,8 @@ export interface JettonHolders { * Check if a given object implements the JettonHolders interface. */ export function instanceOfJettonHolders(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "addresses" in value; - - return isInstance; + if (!('addresses' in value)) return false; + return true; } export function JettonHoldersFromJSON(json: any): JettonHolders { @@ -49,7 +47,7 @@ export function JettonHoldersFromJSON(json: any): JettonHolders { } export function JettonHoldersFromJSONTyped(json: any, ignoreDiscriminator: boolean): JettonHolders { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -59,15 +57,12 @@ export function JettonHoldersFromJSONTyped(json: any, ignoreDiscriminator: boole } export function JettonHoldersToJSON(value?: JettonHolders | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'addresses': ((value.addresses as Array).map(JettonHoldersAddressesInnerToJSON)), + 'addresses': ((value['addresses'] as Array).map(JettonHoldersAddressesInnerToJSON)), }; } diff --git a/packages/core/src/tonApiV2/models/JettonHoldersAddressesInner.ts b/packages/core/src/tonApiV2/models/JettonHoldersAddressesInner.ts index a4e6cb2c6..7aae7fcaf 100644 --- a/packages/core/src/tonApiV2/models/JettonHoldersAddressesInner.ts +++ b/packages/core/src/tonApiV2/models/JettonHoldersAddressesInner.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { AccountAddress } from './AccountAddress'; import { AccountAddressFromJSON, @@ -50,12 +50,10 @@ export interface JettonHoldersAddressesInner { * Check if a given object implements the JettonHoldersAddressesInner interface. */ export function instanceOfJettonHoldersAddressesInner(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "address" in value; - isInstance = isInstance && "owner" in value; - isInstance = isInstance && "balance" in value; - - return isInstance; + if (!('address' in value)) return false; + if (!('owner' in value)) return false; + if (!('balance' in value)) return false; + return true; } export function JettonHoldersAddressesInnerFromJSON(json: any): JettonHoldersAddressesInner { @@ -63,7 +61,7 @@ export function JettonHoldersAddressesInnerFromJSON(json: any): JettonHoldersAdd } export function JettonHoldersAddressesInnerFromJSONTyped(json: any, ignoreDiscriminator: boolean): JettonHoldersAddressesInner { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -75,17 +73,14 @@ export function JettonHoldersAddressesInnerFromJSONTyped(json: any, ignoreDiscri } export function JettonHoldersAddressesInnerToJSON(value?: JettonHoldersAddressesInner | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'address': value.address, - 'owner': AccountAddressToJSON(value.owner), - 'balance': value.balance, + 'address': value['address'], + 'owner': AccountAddressToJSON(value['owner']), + 'balance': value['balance'], }; } diff --git a/packages/core/src/tonApiV2/models/JettonInfo.ts b/packages/core/src/tonApiV2/models/JettonInfo.ts index 8213b13e2..46a4ca4e8 100644 --- a/packages/core/src/tonApiV2/models/JettonInfo.ts +++ b/packages/core/src/tonApiV2/models/JettonInfo.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { JettonMetadata } from './JettonMetadata'; import { JettonMetadataFromJSON, @@ -68,14 +68,12 @@ export interface JettonInfo { * Check if a given object implements the JettonInfo interface. */ export function instanceOfJettonInfo(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "mintable" in value; - isInstance = isInstance && "totalSupply" in value; - isInstance = isInstance && "metadata" in value; - isInstance = isInstance && "verification" in value; - isInstance = isInstance && "holdersCount" in value; - - return isInstance; + if (!('mintable' in value)) return false; + if (!('totalSupply' in value)) return false; + if (!('metadata' in value)) return false; + if (!('verification' in value)) return false; + if (!('holdersCount' in value)) return false; + return true; } export function JettonInfoFromJSON(json: any): JettonInfo { @@ -83,7 +81,7 @@ export function JettonInfoFromJSON(json: any): JettonInfo { } export function JettonInfoFromJSONTyped(json: any, ignoreDiscriminator: boolean): JettonInfo { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -97,19 +95,16 @@ export function JettonInfoFromJSONTyped(json: any, ignoreDiscriminator: boolean) } export function JettonInfoToJSON(value?: JettonInfo | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'mintable': value.mintable, - 'total_supply': value.totalSupply, - 'metadata': JettonMetadataToJSON(value.metadata), - 'verification': JettonVerificationTypeToJSON(value.verification), - 'holders_count': value.holdersCount, + 'mintable': value['mintable'], + 'total_supply': value['totalSupply'], + 'metadata': JettonMetadataToJSON(value['metadata']), + 'verification': JettonVerificationTypeToJSON(value['verification']), + 'holders_count': value['holdersCount'], }; } diff --git a/packages/core/src/tonApiV2/models/JettonMetadata.ts b/packages/core/src/tonApiV2/models/JettonMetadata.ts index 2aec8187d..7c576df1b 100644 --- a/packages/core/src/tonApiV2/models/JettonMetadata.ts +++ b/packages/core/src/tonApiV2/models/JettonMetadata.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -79,13 +79,11 @@ export interface JettonMetadata { * Check if a given object implements the JettonMetadata interface. */ export function instanceOfJettonMetadata(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "address" in value; - isInstance = isInstance && "name" in value; - isInstance = isInstance && "symbol" in value; - isInstance = isInstance && "decimals" in value; - - return isInstance; + if (!('address' in value)) return false; + if (!('name' in value)) return false; + if (!('symbol' in value)) return false; + if (!('decimals' in value)) return false; + return true; } export function JettonMetadataFromJSON(json: any): JettonMetadata { @@ -93,7 +91,7 @@ export function JettonMetadataFromJSON(json: any): JettonMetadata { } export function JettonMetadataFromJSONTyped(json: any, ignoreDiscriminator: boolean): JettonMetadata { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -102,32 +100,29 @@ export function JettonMetadataFromJSONTyped(json: any, ignoreDiscriminator: bool 'name': json['name'], 'symbol': json['symbol'], 'decimals': json['decimals'], - 'image': !exists(json, 'image') ? undefined : json['image'], - 'description': !exists(json, 'description') ? undefined : json['description'], - 'social': !exists(json, 'social') ? undefined : json['social'], - 'websites': !exists(json, 'websites') ? undefined : json['websites'], - 'catalogs': !exists(json, 'catalogs') ? undefined : json['catalogs'], + 'image': json['image'] == null ? undefined : json['image'], + 'description': json['description'] == null ? undefined : json['description'], + 'social': json['social'] == null ? undefined : json['social'], + 'websites': json['websites'] == null ? undefined : json['websites'], + 'catalogs': json['catalogs'] == null ? undefined : json['catalogs'], }; } export function JettonMetadataToJSON(value?: JettonMetadata | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'address': value.address, - 'name': value.name, - 'symbol': value.symbol, - 'decimals': value.decimals, - 'image': value.image, - 'description': value.description, - 'social': value.social, - 'websites': value.websites, - 'catalogs': value.catalogs, + 'address': value['address'], + 'name': value['name'], + 'symbol': value['symbol'], + 'decimals': value['decimals'], + 'image': value['image'], + 'description': value['description'], + 'social': value['social'], + 'websites': value['websites'], + 'catalogs': value['catalogs'], }; } diff --git a/packages/core/src/tonApiV2/models/JettonMintAction.ts b/packages/core/src/tonApiV2/models/JettonMintAction.ts index 3aa6850fa..3d71be0fb 100644 --- a/packages/core/src/tonApiV2/models/JettonMintAction.ts +++ b/packages/core/src/tonApiV2/models/JettonMintAction.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { AccountAddress } from './AccountAddress'; import { AccountAddressFromJSON, @@ -62,13 +62,11 @@ export interface JettonMintAction { * Check if a given object implements the JettonMintAction interface. */ export function instanceOfJettonMintAction(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "recipient" in value; - isInstance = isInstance && "recipientsWallet" in value; - isInstance = isInstance && "amount" in value; - isInstance = isInstance && "jetton" in value; - - return isInstance; + if (!('recipient' in value)) return false; + if (!('recipientsWallet' in value)) return false; + if (!('amount' in value)) return false; + if (!('jetton' in value)) return false; + return true; } export function JettonMintActionFromJSON(json: any): JettonMintAction { @@ -76,7 +74,7 @@ export function JettonMintActionFromJSON(json: any): JettonMintAction { } export function JettonMintActionFromJSONTyped(json: any, ignoreDiscriminator: boolean): JettonMintAction { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -89,18 +87,15 @@ export function JettonMintActionFromJSONTyped(json: any, ignoreDiscriminator: bo } export function JettonMintActionToJSON(value?: JettonMintAction | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'recipient': AccountAddressToJSON(value.recipient), - 'recipients_wallet': value.recipientsWallet, - 'amount': value.amount, - 'jetton': JettonPreviewToJSON(value.jetton), + 'recipient': AccountAddressToJSON(value['recipient']), + 'recipients_wallet': value['recipientsWallet'], + 'amount': value['amount'], + 'jetton': JettonPreviewToJSON(value['jetton']), }; } diff --git a/packages/core/src/tonApiV2/models/JettonPreview.ts b/packages/core/src/tonApiV2/models/JettonPreview.ts index 8535c3ee6..7e20a9eb1 100644 --- a/packages/core/src/tonApiV2/models/JettonPreview.ts +++ b/packages/core/src/tonApiV2/models/JettonPreview.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { JettonVerificationType } from './JettonVerificationType'; import { JettonVerificationTypeFromJSON, @@ -68,15 +68,13 @@ export interface JettonPreview { * Check if a given object implements the JettonPreview interface. */ export function instanceOfJettonPreview(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "address" in value; - isInstance = isInstance && "name" in value; - isInstance = isInstance && "symbol" in value; - isInstance = isInstance && "decimals" in value; - isInstance = isInstance && "image" in value; - isInstance = isInstance && "verification" in value; - - return isInstance; + if (!('address' in value)) return false; + if (!('name' in value)) return false; + if (!('symbol' in value)) return false; + if (!('decimals' in value)) return false; + if (!('image' in value)) return false; + if (!('verification' in value)) return false; + return true; } export function JettonPreviewFromJSON(json: any): JettonPreview { @@ -84,7 +82,7 @@ export function JettonPreviewFromJSON(json: any): JettonPreview { } export function JettonPreviewFromJSONTyped(json: any, ignoreDiscriminator: boolean): JettonPreview { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -99,20 +97,17 @@ export function JettonPreviewFromJSONTyped(json: any, ignoreDiscriminator: boole } export function JettonPreviewToJSON(value?: JettonPreview | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'address': value.address, - 'name': value.name, - 'symbol': value.symbol, - 'decimals': value.decimals, - 'image': value.image, - 'verification': JettonVerificationTypeToJSON(value.verification), + 'address': value['address'], + 'name': value['name'], + 'symbol': value['symbol'], + 'decimals': value['decimals'], + 'image': value['image'], + 'verification': JettonVerificationTypeToJSON(value['verification']), }; } diff --git a/packages/core/src/tonApiV2/models/JettonQuantity.ts b/packages/core/src/tonApiV2/models/JettonQuantity.ts index 227bf9679..fa5bed533 100644 --- a/packages/core/src/tonApiV2/models/JettonQuantity.ts +++ b/packages/core/src/tonApiV2/models/JettonQuantity.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { AccountAddress } from './AccountAddress'; import { AccountAddressFromJSON, @@ -56,12 +56,10 @@ export interface JettonQuantity { * Check if a given object implements the JettonQuantity interface. */ export function instanceOfJettonQuantity(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "quantity" in value; - isInstance = isInstance && "walletAddress" in value; - isInstance = isInstance && "jetton" in value; - - return isInstance; + if (!('quantity' in value)) return false; + if (!('walletAddress' in value)) return false; + if (!('jetton' in value)) return false; + return true; } export function JettonQuantityFromJSON(json: any): JettonQuantity { @@ -69,7 +67,7 @@ export function JettonQuantityFromJSON(json: any): JettonQuantity { } export function JettonQuantityFromJSONTyped(json: any, ignoreDiscriminator: boolean): JettonQuantity { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -81,17 +79,14 @@ export function JettonQuantityFromJSONTyped(json: any, ignoreDiscriminator: bool } export function JettonQuantityToJSON(value?: JettonQuantity | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'quantity': value.quantity, - 'wallet_address': AccountAddressToJSON(value.walletAddress), - 'jetton': JettonPreviewToJSON(value.jetton), + 'quantity': value['quantity'], + 'wallet_address': AccountAddressToJSON(value['walletAddress']), + 'jetton': JettonPreviewToJSON(value['jetton']), }; } diff --git a/packages/core/src/tonApiV2/models/JettonSwapAction.ts b/packages/core/src/tonApiV2/models/JettonSwapAction.ts index 3cbfd5d6c..b819e6c6a 100644 --- a/packages/core/src/tonApiV2/models/JettonSwapAction.ts +++ b/packages/core/src/tonApiV2/models/JettonSwapAction.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { AccountAddress } from './AccountAddress'; import { AccountAddressFromJSON, @@ -104,14 +104,12 @@ export type JettonSwapActionDexEnum = typeof JettonSwapActionDexEnum[keyof typeo * Check if a given object implements the JettonSwapAction interface. */ export function instanceOfJettonSwapAction(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "dex" in value; - isInstance = isInstance && "amountIn" in value; - isInstance = isInstance && "amountOut" in value; - isInstance = isInstance && "userWallet" in value; - isInstance = isInstance && "router" in value; - - return isInstance; + if (!('dex' in value)) return false; + if (!('amountIn' in value)) return false; + if (!('amountOut' in value)) return false; + if (!('userWallet' in value)) return false; + if (!('router' in value)) return false; + return true; } export function JettonSwapActionFromJSON(json: any): JettonSwapAction { @@ -119,7 +117,7 @@ export function JettonSwapActionFromJSON(json: any): JettonSwapAction { } export function JettonSwapActionFromJSONTyped(json: any, ignoreDiscriminator: boolean): JettonSwapAction { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -127,33 +125,30 @@ export function JettonSwapActionFromJSONTyped(json: any, ignoreDiscriminator: bo 'dex': json['dex'], 'amountIn': json['amount_in'], 'amountOut': json['amount_out'], - 'tonIn': !exists(json, 'ton_in') ? undefined : json['ton_in'], - 'tonOut': !exists(json, 'ton_out') ? undefined : json['ton_out'], + 'tonIn': json['ton_in'] == null ? undefined : json['ton_in'], + 'tonOut': json['ton_out'] == null ? undefined : json['ton_out'], 'userWallet': AccountAddressFromJSON(json['user_wallet']), 'router': AccountAddressFromJSON(json['router']), - 'jettonMasterIn': !exists(json, 'jetton_master_in') ? undefined : JettonPreviewFromJSON(json['jetton_master_in']), - 'jettonMasterOut': !exists(json, 'jetton_master_out') ? undefined : JettonPreviewFromJSON(json['jetton_master_out']), + 'jettonMasterIn': json['jetton_master_in'] == null ? undefined : JettonPreviewFromJSON(json['jetton_master_in']), + 'jettonMasterOut': json['jetton_master_out'] == null ? undefined : JettonPreviewFromJSON(json['jetton_master_out']), }; } export function JettonSwapActionToJSON(value?: JettonSwapAction | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'dex': value.dex, - 'amount_in': value.amountIn, - 'amount_out': value.amountOut, - 'ton_in': value.tonIn, - 'ton_out': value.tonOut, - 'user_wallet': AccountAddressToJSON(value.userWallet), - 'router': AccountAddressToJSON(value.router), - 'jetton_master_in': JettonPreviewToJSON(value.jettonMasterIn), - 'jetton_master_out': JettonPreviewToJSON(value.jettonMasterOut), + 'dex': value['dex'], + 'amount_in': value['amountIn'], + 'amount_out': value['amountOut'], + 'ton_in': value['tonIn'], + 'ton_out': value['tonOut'], + 'user_wallet': AccountAddressToJSON(value['userWallet']), + 'router': AccountAddressToJSON(value['router']), + 'jetton_master_in': JettonPreviewToJSON(value['jettonMasterIn']), + 'jetton_master_out': JettonPreviewToJSON(value['jettonMasterOut']), }; } diff --git a/packages/core/src/tonApiV2/models/JettonTransferAction.ts b/packages/core/src/tonApiV2/models/JettonTransferAction.ts index a486b8769..5bf93454e 100644 --- a/packages/core/src/tonApiV2/models/JettonTransferAction.ts +++ b/packages/core/src/tonApiV2/models/JettonTransferAction.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { AccountAddress } from './AccountAddress'; import { AccountAddressFromJSON, @@ -104,13 +104,11 @@ export interface JettonTransferAction { * Check if a given object implements the JettonTransferAction interface. */ export function instanceOfJettonTransferAction(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "sendersWallet" in value; - isInstance = isInstance && "recipientsWallet" in value; - isInstance = isInstance && "amount" in value; - isInstance = isInstance && "jetton" in value; - - return isInstance; + if (!('sendersWallet' in value)) return false; + if (!('recipientsWallet' in value)) return false; + if (!('amount' in value)) return false; + if (!('jetton' in value)) return false; + return true; } export function JettonTransferActionFromJSON(json: any): JettonTransferAction { @@ -118,41 +116,38 @@ export function JettonTransferActionFromJSON(json: any): JettonTransferAction { } export function JettonTransferActionFromJSONTyped(json: any, ignoreDiscriminator: boolean): JettonTransferAction { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { - 'sender': !exists(json, 'sender') ? undefined : AccountAddressFromJSON(json['sender']), - 'recipient': !exists(json, 'recipient') ? undefined : AccountAddressFromJSON(json['recipient']), + 'sender': json['sender'] == null ? undefined : AccountAddressFromJSON(json['sender']), + 'recipient': json['recipient'] == null ? undefined : AccountAddressFromJSON(json['recipient']), 'sendersWallet': json['senders_wallet'], 'recipientsWallet': json['recipients_wallet'], 'amount': json['amount'], - 'comment': !exists(json, 'comment') ? undefined : json['comment'], - 'encryptedComment': !exists(json, 'encrypted_comment') ? undefined : EncryptedCommentFromJSON(json['encrypted_comment']), - 'refund': !exists(json, 'refund') ? undefined : RefundFromJSON(json['refund']), + 'comment': json['comment'] == null ? undefined : json['comment'], + 'encryptedComment': json['encrypted_comment'] == null ? undefined : EncryptedCommentFromJSON(json['encrypted_comment']), + 'refund': json['refund'] == null ? undefined : RefundFromJSON(json['refund']), 'jetton': JettonPreviewFromJSON(json['jetton']), }; } export function JettonTransferActionToJSON(value?: JettonTransferAction | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'sender': AccountAddressToJSON(value.sender), - 'recipient': AccountAddressToJSON(value.recipient), - 'senders_wallet': value.sendersWallet, - 'recipients_wallet': value.recipientsWallet, - 'amount': value.amount, - 'comment': value.comment, - 'encrypted_comment': EncryptedCommentToJSON(value.encryptedComment), - 'refund': RefundToJSON(value.refund), - 'jetton': JettonPreviewToJSON(value.jetton), + 'sender': AccountAddressToJSON(value['sender']), + 'recipient': AccountAddressToJSON(value['recipient']), + 'senders_wallet': value['sendersWallet'], + 'recipients_wallet': value['recipientsWallet'], + 'amount': value['amount'], + 'comment': value['comment'], + 'encrypted_comment': EncryptedCommentToJSON(value['encryptedComment']), + 'refund': RefundToJSON(value['refund']), + 'jetton': JettonPreviewToJSON(value['jetton']), }; } diff --git a/packages/core/src/tonApiV2/models/Jettons.ts b/packages/core/src/tonApiV2/models/Jettons.ts index 3fb340b2c..aea13cf88 100644 --- a/packages/core/src/tonApiV2/models/Jettons.ts +++ b/packages/core/src/tonApiV2/models/Jettons.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { JettonInfo } from './JettonInfo'; import { JettonInfoFromJSON, @@ -38,10 +38,8 @@ export interface Jettons { * Check if a given object implements the Jettons interface. */ export function instanceOfJettons(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "jettons" in value; - - return isInstance; + if (!('jettons' in value)) return false; + return true; } export function JettonsFromJSON(json: any): Jettons { @@ -49,7 +47,7 @@ export function JettonsFromJSON(json: any): Jettons { } export function JettonsFromJSONTyped(json: any, ignoreDiscriminator: boolean): Jettons { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -59,15 +57,12 @@ export function JettonsFromJSONTyped(json: any, ignoreDiscriminator: boolean): J } export function JettonsToJSON(value?: Jettons | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'jettons': ((value.jettons as Array).map(JettonInfoToJSON)), + 'jettons': ((value['jettons'] as Array).map(JettonInfoToJSON)), }; } diff --git a/packages/core/src/tonApiV2/models/JettonsBalances.ts b/packages/core/src/tonApiV2/models/JettonsBalances.ts index 6c008b61b..8b448f6c5 100644 --- a/packages/core/src/tonApiV2/models/JettonsBalances.ts +++ b/packages/core/src/tonApiV2/models/JettonsBalances.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { JettonBalance } from './JettonBalance'; import { JettonBalanceFromJSON, @@ -38,10 +38,8 @@ export interface JettonsBalances { * Check if a given object implements the JettonsBalances interface. */ export function instanceOfJettonsBalances(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "balances" in value; - - return isInstance; + if (!('balances' in value)) return false; + return true; } export function JettonsBalancesFromJSON(json: any): JettonsBalances { @@ -49,7 +47,7 @@ export function JettonsBalancesFromJSON(json: any): JettonsBalances { } export function JettonsBalancesFromJSONTyped(json: any, ignoreDiscriminator: boolean): JettonsBalances { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -59,15 +57,12 @@ export function JettonsBalancesFromJSONTyped(json: any, ignoreDiscriminator: boo } export function JettonsBalancesToJSON(value?: JettonsBalances | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'balances': ((value.balances as Array).map(JettonBalanceToJSON)), + 'balances': ((value['balances'] as Array).map(JettonBalanceToJSON)), }; } diff --git a/packages/core/src/tonApiV2/models/Message.ts b/packages/core/src/tonApiV2/models/Message.ts index 568b89a01..cddef3509 100644 --- a/packages/core/src/tonApiV2/models/Message.ts +++ b/packages/core/src/tonApiV2/models/Message.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { AccountAddress } from './AccountAddress'; import { AccountAddressFromJSON, @@ -133,7 +133,7 @@ export interface Message { * @type {any} * @memberof Message */ - decodedBody?: any | null; + decodedBody?: any; } @@ -152,19 +152,17 @@ export type MessageMsgTypeEnum = typeof MessageMsgTypeEnum[keyof typeof MessageM * Check if a given object implements the Message interface. */ export function instanceOfMessage(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "msgType" in value; - isInstance = isInstance && "createdLt" in value; - isInstance = isInstance && "ihrDisabled" in value; - isInstance = isInstance && "bounce" in value; - isInstance = isInstance && "bounced" in value; - isInstance = isInstance && "value" in value; - isInstance = isInstance && "fwdFee" in value; - isInstance = isInstance && "ihrFee" in value; - isInstance = isInstance && "importFee" in value; - isInstance = isInstance && "createdAt" in value; - - return isInstance; + if (!('msgType' in value)) return false; + if (!('createdLt' in value)) return false; + if (!('ihrDisabled' in value)) return false; + if (!('bounce' in value)) return false; + if (!('bounced' in value)) return false; + if (!('value' in value)) return false; + if (!('fwdFee' in value)) return false; + if (!('ihrFee' in value)) return false; + if (!('importFee' in value)) return false; + if (!('createdAt' in value)) return false; + return true; } export function MessageFromJSON(json: any): Message { @@ -172,7 +170,7 @@ export function MessageFromJSON(json: any): Message { } export function MessageFromJSONTyped(json: any, ignoreDiscriminator: boolean): Message { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -185,44 +183,41 @@ export function MessageFromJSONTyped(json: any, ignoreDiscriminator: boolean): M 'value': json['value'], 'fwdFee': json['fwd_fee'], 'ihrFee': json['ihr_fee'], - 'destination': !exists(json, 'destination') ? undefined : AccountAddressFromJSON(json['destination']), - 'source': !exists(json, 'source') ? undefined : AccountAddressFromJSON(json['source']), + 'destination': json['destination'] == null ? undefined : AccountAddressFromJSON(json['destination']), + 'source': json['source'] == null ? undefined : AccountAddressFromJSON(json['source']), 'importFee': json['import_fee'], 'createdAt': json['created_at'], - 'opCode': !exists(json, 'op_code') ? undefined : json['op_code'], - 'init': !exists(json, 'init') ? undefined : StateInitFromJSON(json['init']), - 'rawBody': !exists(json, 'raw_body') ? undefined : json['raw_body'], - 'decodedOpName': !exists(json, 'decoded_op_name') ? undefined : json['decoded_op_name'], - 'decodedBody': !exists(json, 'decoded_body') ? undefined : json['decoded_body'], + 'opCode': json['op_code'] == null ? undefined : json['op_code'], + 'init': json['init'] == null ? undefined : StateInitFromJSON(json['init']), + 'rawBody': json['raw_body'] == null ? undefined : json['raw_body'], + 'decodedOpName': json['decoded_op_name'] == null ? undefined : json['decoded_op_name'], + 'decodedBody': json['decoded_body'] == null ? undefined : json['decoded_body'], }; } export function MessageToJSON(value?: Message | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'msg_type': value.msgType, - 'created_lt': value.createdLt, - 'ihr_disabled': value.ihrDisabled, - 'bounce': value.bounce, - 'bounced': value.bounced, - 'value': value.value, - 'fwd_fee': value.fwdFee, - 'ihr_fee': value.ihrFee, - 'destination': AccountAddressToJSON(value.destination), - 'source': AccountAddressToJSON(value.source), - 'import_fee': value.importFee, - 'created_at': value.createdAt, - 'op_code': value.opCode, - 'init': StateInitToJSON(value.init), - 'raw_body': value.rawBody, - 'decoded_op_name': value.decodedOpName, - 'decoded_body': value.decodedBody, + 'msg_type': value['msgType'], + 'created_lt': value['createdLt'], + 'ihr_disabled': value['ihrDisabled'], + 'bounce': value['bounce'], + 'bounced': value['bounced'], + 'value': value['value'], + 'fwd_fee': value['fwdFee'], + 'ihr_fee': value['ihrFee'], + 'destination': AccountAddressToJSON(value['destination']), + 'source': AccountAddressToJSON(value['source']), + 'import_fee': value['importFee'], + 'created_at': value['createdAt'], + 'op_code': value['opCode'], + 'init': StateInitToJSON(value['init']), + 'raw_body': value['rawBody'], + 'decoded_op_name': value['decodedOpName'], + 'decoded_body': value['decodedBody'], }; } diff --git a/packages/core/src/tonApiV2/models/MessageConsequences.ts b/packages/core/src/tonApiV2/models/MessageConsequences.ts index d7602bad6..461cbc9a0 100644 --- a/packages/core/src/tonApiV2/models/MessageConsequences.ts +++ b/packages/core/src/tonApiV2/models/MessageConsequences.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { AccountEvent } from './AccountEvent'; import { AccountEventFromJSON, @@ -62,12 +62,10 @@ export interface MessageConsequences { * Check if a given object implements the MessageConsequences interface. */ export function instanceOfMessageConsequences(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "trace" in value; - isInstance = isInstance && "risk" in value; - isInstance = isInstance && "event" in value; - - return isInstance; + if (!('trace' in value)) return false; + if (!('risk' in value)) return false; + if (!('event' in value)) return false; + return true; } export function MessageConsequencesFromJSON(json: any): MessageConsequences { @@ -75,7 +73,7 @@ export function MessageConsequencesFromJSON(json: any): MessageConsequences { } export function MessageConsequencesFromJSONTyped(json: any, ignoreDiscriminator: boolean): MessageConsequences { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -87,17 +85,14 @@ export function MessageConsequencesFromJSONTyped(json: any, ignoreDiscriminator: } export function MessageConsequencesToJSON(value?: MessageConsequences | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'trace': TraceToJSON(value.trace), - 'risk': RiskToJSON(value.risk), - 'event': AccountEventToJSON(value.event), + 'trace': TraceToJSON(value['trace']), + 'risk': RiskToJSON(value['risk']), + 'event': AccountEventToJSON(value['event']), }; } diff --git a/packages/core/src/tonApiV2/models/MethodExecutionResult.ts b/packages/core/src/tonApiV2/models/MethodExecutionResult.ts index 79d24be61..db5ac179f 100644 --- a/packages/core/src/tonApiV2/models/MethodExecutionResult.ts +++ b/packages/core/src/tonApiV2/models/MethodExecutionResult.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { TvmStackRecord } from './TvmStackRecord'; import { TvmStackRecordFromJSON, @@ -49,19 +49,17 @@ export interface MethodExecutionResult { * @type {any} * @memberof MethodExecutionResult */ - decoded?: any | null; + decoded?: any; } /** * Check if a given object implements the MethodExecutionResult interface. */ export function instanceOfMethodExecutionResult(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "success" in value; - isInstance = isInstance && "exitCode" in value; - isInstance = isInstance && "stack" in value; - - return isInstance; + if (!('success' in value)) return false; + if (!('exitCode' in value)) return false; + if (!('stack' in value)) return false; + return true; } export function MethodExecutionResultFromJSON(json: any): MethodExecutionResult { @@ -69,7 +67,7 @@ export function MethodExecutionResultFromJSON(json: any): MethodExecutionResult } export function MethodExecutionResultFromJSONTyped(json: any, ignoreDiscriminator: boolean): MethodExecutionResult { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -77,23 +75,20 @@ export function MethodExecutionResultFromJSONTyped(json: any, ignoreDiscriminato 'success': json['success'], 'exitCode': json['exit_code'], 'stack': ((json['stack'] as Array).map(TvmStackRecordFromJSON)), - 'decoded': !exists(json, 'decoded') ? undefined : json['decoded'], + 'decoded': json['decoded'] == null ? undefined : json['decoded'], }; } export function MethodExecutionResultToJSON(value?: MethodExecutionResult | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'success': value.success, - 'exit_code': value.exitCode, - 'stack': ((value.stack as Array).map(TvmStackRecordToJSON)), - 'decoded': value.decoded, + 'success': value['success'], + 'exit_code': value['exitCode'], + 'stack': ((value['stack'] as Array).map(TvmStackRecordToJSON)), + 'decoded': value['decoded'], }; } diff --git a/packages/core/src/tonApiV2/models/MisbehaviourPunishmentConfig.ts b/packages/core/src/tonApiV2/models/MisbehaviourPunishmentConfig.ts index 01465e7fa..5b62362c2 100644 --- a/packages/core/src/tonApiV2/models/MisbehaviourPunishmentConfig.ts +++ b/packages/core/src/tonApiV2/models/MisbehaviourPunishmentConfig.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -91,20 +91,18 @@ export interface MisbehaviourPunishmentConfig { * Check if a given object implements the MisbehaviourPunishmentConfig interface. */ export function instanceOfMisbehaviourPunishmentConfig(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "defaultFlatFine" in value; - isInstance = isInstance && "defaultProportionalFine" in value; - isInstance = isInstance && "severityFlatMult" in value; - isInstance = isInstance && "severityProportionalMult" in value; - isInstance = isInstance && "unpunishableInterval" in value; - isInstance = isInstance && "longInterval" in value; - isInstance = isInstance && "longFlatMult" in value; - isInstance = isInstance && "longProportionalMult" in value; - isInstance = isInstance && "mediumInterval" in value; - isInstance = isInstance && "mediumFlatMult" in value; - isInstance = isInstance && "mediumProportionalMult" in value; - - return isInstance; + if (!('defaultFlatFine' in value)) return false; + if (!('defaultProportionalFine' in value)) return false; + if (!('severityFlatMult' in value)) return false; + if (!('severityProportionalMult' in value)) return false; + if (!('unpunishableInterval' in value)) return false; + if (!('longInterval' in value)) return false; + if (!('longFlatMult' in value)) return false; + if (!('longProportionalMult' in value)) return false; + if (!('mediumInterval' in value)) return false; + if (!('mediumFlatMult' in value)) return false; + if (!('mediumProportionalMult' in value)) return false; + return true; } export function MisbehaviourPunishmentConfigFromJSON(json: any): MisbehaviourPunishmentConfig { @@ -112,7 +110,7 @@ export function MisbehaviourPunishmentConfigFromJSON(json: any): MisbehaviourPun } export function MisbehaviourPunishmentConfigFromJSONTyped(json: any, ignoreDiscriminator: boolean): MisbehaviourPunishmentConfig { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -132,25 +130,22 @@ export function MisbehaviourPunishmentConfigFromJSONTyped(json: any, ignoreDiscr } export function MisbehaviourPunishmentConfigToJSON(value?: MisbehaviourPunishmentConfig | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'default_flat_fine': value.defaultFlatFine, - 'default_proportional_fine': value.defaultProportionalFine, - 'severity_flat_mult': value.severityFlatMult, - 'severity_proportional_mult': value.severityProportionalMult, - 'unpunishable_interval': value.unpunishableInterval, - 'long_interval': value.longInterval, - 'long_flat_mult': value.longFlatMult, - 'long_proportional_mult': value.longProportionalMult, - 'medium_interval': value.mediumInterval, - 'medium_flat_mult': value.mediumFlatMult, - 'medium_proportional_mult': value.mediumProportionalMult, + 'default_flat_fine': value['defaultFlatFine'], + 'default_proportional_fine': value['defaultProportionalFine'], + 'severity_flat_mult': value['severityFlatMult'], + 'severity_proportional_mult': value['severityProportionalMult'], + 'unpunishable_interval': value['unpunishableInterval'], + 'long_interval': value['longInterval'], + 'long_flat_mult': value['longFlatMult'], + 'long_proportional_mult': value['longProportionalMult'], + 'medium_interval': value['mediumInterval'], + 'medium_flat_mult': value['mediumFlatMult'], + 'medium_proportional_mult': value['mediumProportionalMult'], }; } diff --git a/packages/core/src/tonApiV2/models/ModelError.ts b/packages/core/src/tonApiV2/models/ModelError.ts index 8e23f5035..5fb8f2580 100644 --- a/packages/core/src/tonApiV2/models/ModelError.ts +++ b/packages/core/src/tonApiV2/models/ModelError.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -31,10 +31,8 @@ export interface ModelError { * Check if a given object implements the ModelError interface. */ export function instanceOfModelError(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "error" in value; - - return isInstance; + if (!('error' in value)) return false; + return true; } export function ModelErrorFromJSON(json: any): ModelError { @@ -42,7 +40,7 @@ export function ModelErrorFromJSON(json: any): ModelError { } export function ModelErrorFromJSONTyped(json: any, ignoreDiscriminator: boolean): ModelError { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -52,15 +50,12 @@ export function ModelErrorFromJSONTyped(json: any, ignoreDiscriminator: boolean) } export function ModelErrorToJSON(value?: ModelError | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'error': value.error, + 'error': value['error'], }; } diff --git a/packages/core/src/tonApiV2/models/MsgForwardPrices.ts b/packages/core/src/tonApiV2/models/MsgForwardPrices.ts index f1255183f..7875b4734 100644 --- a/packages/core/src/tonApiV2/models/MsgForwardPrices.ts +++ b/packages/core/src/tonApiV2/models/MsgForwardPrices.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -61,15 +61,13 @@ export interface MsgForwardPrices { * Check if a given object implements the MsgForwardPrices interface. */ export function instanceOfMsgForwardPrices(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "lumpPrice" in value; - isInstance = isInstance && "bitPrice" in value; - isInstance = isInstance && "cellPrice" in value; - isInstance = isInstance && "ihrPriceFactor" in value; - isInstance = isInstance && "firstFrac" in value; - isInstance = isInstance && "nextFrac" in value; - - return isInstance; + if (!('lumpPrice' in value)) return false; + if (!('bitPrice' in value)) return false; + if (!('cellPrice' in value)) return false; + if (!('ihrPriceFactor' in value)) return false; + if (!('firstFrac' in value)) return false; + if (!('nextFrac' in value)) return false; + return true; } export function MsgForwardPricesFromJSON(json: any): MsgForwardPrices { @@ -77,7 +75,7 @@ export function MsgForwardPricesFromJSON(json: any): MsgForwardPrices { } export function MsgForwardPricesFromJSONTyped(json: any, ignoreDiscriminator: boolean): MsgForwardPrices { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -92,20 +90,17 @@ export function MsgForwardPricesFromJSONTyped(json: any, ignoreDiscriminator: bo } export function MsgForwardPricesToJSON(value?: MsgForwardPrices | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'lump_price': value.lumpPrice, - 'bit_price': value.bitPrice, - 'cell_price': value.cellPrice, - 'ihr_price_factor': value.ihrPriceFactor, - 'first_frac': value.firstFrac, - 'next_frac': value.nextFrac, + 'lump_price': value['lumpPrice'], + 'bit_price': value['bitPrice'], + 'cell_price': value['cellPrice'], + 'ihr_price_factor': value['ihrPriceFactor'], + 'first_frac': value['firstFrac'], + 'next_frac': value['nextFrac'], }; } diff --git a/packages/core/src/tonApiV2/models/NftCollection.ts b/packages/core/src/tonApiV2/models/NftCollection.ts index a68776593..a0a279ca1 100644 --- a/packages/core/src/tonApiV2/models/NftCollection.ts +++ b/packages/core/src/tonApiV2/models/NftCollection.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { AccountAddress } from './AccountAddress'; import { AccountAddressFromJSON, @@ -92,13 +92,11 @@ export type NftCollectionApprovedByEnum = typeof NftCollectionApprovedByEnum[key * Check if a given object implements the NftCollection interface. */ export function instanceOfNftCollection(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "address" in value; - isInstance = isInstance && "nextItemIndex" in value; - isInstance = isInstance && "rawCollectionContent" in value; - isInstance = isInstance && "approvedBy" in value; - - return isInstance; + if (!('address' in value)) return false; + if (!('nextItemIndex' in value)) return false; + if (!('rawCollectionContent' in value)) return false; + if (!('approvedBy' in value)) return false; + return true; } export function NftCollectionFromJSON(json: any): NftCollection { @@ -106,37 +104,34 @@ export function NftCollectionFromJSON(json: any): NftCollection { } export function NftCollectionFromJSONTyped(json: any, ignoreDiscriminator: boolean): NftCollection { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'address': json['address'], 'nextItemIndex': json['next_item_index'], - 'owner': !exists(json, 'owner') ? undefined : AccountAddressFromJSON(json['owner']), + 'owner': json['owner'] == null ? undefined : AccountAddressFromJSON(json['owner']), 'rawCollectionContent': json['raw_collection_content'], - 'metadata': !exists(json, 'metadata') ? undefined : json['metadata'], - 'previews': !exists(json, 'previews') ? undefined : ((json['previews'] as Array).map(ImagePreviewFromJSON)), + 'metadata': json['metadata'] == null ? undefined : json['metadata'], + 'previews': json['previews'] == null ? undefined : ((json['previews'] as Array).map(ImagePreviewFromJSON)), 'approvedBy': json['approved_by'], }; } export function NftCollectionToJSON(value?: NftCollection | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'address': value.address, - 'next_item_index': value.nextItemIndex, - 'owner': AccountAddressToJSON(value.owner), - 'raw_collection_content': value.rawCollectionContent, - 'metadata': value.metadata, - 'previews': value.previews === undefined ? undefined : ((value.previews as Array).map(ImagePreviewToJSON)), - 'approved_by': value.approvedBy, + 'address': value['address'], + 'next_item_index': value['nextItemIndex'], + 'owner': AccountAddressToJSON(value['owner']), + 'raw_collection_content': value['rawCollectionContent'], + 'metadata': value['metadata'], + 'previews': value['previews'] == null ? undefined : ((value['previews'] as Array).map(ImagePreviewToJSON)), + 'approved_by': value['approvedBy'], }; } diff --git a/packages/core/src/tonApiV2/models/NftCollections.ts b/packages/core/src/tonApiV2/models/NftCollections.ts index a12933249..7061b3cd7 100644 --- a/packages/core/src/tonApiV2/models/NftCollections.ts +++ b/packages/core/src/tonApiV2/models/NftCollections.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { NftCollection } from './NftCollection'; import { NftCollectionFromJSON, @@ -38,10 +38,8 @@ export interface NftCollections { * Check if a given object implements the NftCollections interface. */ export function instanceOfNftCollections(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "nftCollections" in value; - - return isInstance; + if (!('nftCollections' in value)) return false; + return true; } export function NftCollectionsFromJSON(json: any): NftCollections { @@ -49,7 +47,7 @@ export function NftCollectionsFromJSON(json: any): NftCollections { } export function NftCollectionsFromJSONTyped(json: any, ignoreDiscriminator: boolean): NftCollections { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -59,15 +57,12 @@ export function NftCollectionsFromJSONTyped(json: any, ignoreDiscriminator: bool } export function NftCollectionsToJSON(value?: NftCollections | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'nft_collections': ((value.nftCollections as Array).map(NftCollectionToJSON)), + 'nft_collections': ((value['nftCollections'] as Array).map(NftCollectionToJSON)), }; } diff --git a/packages/core/src/tonApiV2/models/NftItem.ts b/packages/core/src/tonApiV2/models/NftItem.ts index 10ddc609d..1e651fd72 100644 --- a/packages/core/src/tonApiV2/models/NftItem.ts +++ b/packages/core/src/tonApiV2/models/NftItem.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { AccountAddress } from './AccountAddress'; import { AccountAddressFromJSON, @@ -122,14 +122,12 @@ export type NftItemApprovedByEnum = typeof NftItemApprovedByEnum[keyof typeof Nf * Check if a given object implements the NftItem interface. */ export function instanceOfNftItem(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "address" in value; - isInstance = isInstance && "index" in value; - isInstance = isInstance && "verified" in value; - isInstance = isInstance && "metadata" in value; - isInstance = isInstance && "approvedBy" in value; - - return isInstance; + if (!('address' in value)) return false; + if (!('index' in value)) return false; + if (!('verified' in value)) return false; + if (!('metadata' in value)) return false; + if (!('approvedBy' in value)) return false; + return true; } export function NftItemFromJSON(json: any): NftItem { @@ -137,43 +135,40 @@ export function NftItemFromJSON(json: any): NftItem { } export function NftItemFromJSONTyped(json: any, ignoreDiscriminator: boolean): NftItem { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'address': json['address'], 'index': json['index'], - 'owner': !exists(json, 'owner') ? undefined : AccountAddressFromJSON(json['owner']), - 'collection': !exists(json, 'collection') ? undefined : NftItemCollectionFromJSON(json['collection']), + 'owner': json['owner'] == null ? undefined : AccountAddressFromJSON(json['owner']), + 'collection': json['collection'] == null ? undefined : NftItemCollectionFromJSON(json['collection']), 'verified': json['verified'], 'metadata': json['metadata'], - 'sale': !exists(json, 'sale') ? undefined : SaleFromJSON(json['sale']), - 'previews': !exists(json, 'previews') ? undefined : ((json['previews'] as Array).map(ImagePreviewFromJSON)), - 'dns': !exists(json, 'dns') ? undefined : json['dns'], + 'sale': json['sale'] == null ? undefined : SaleFromJSON(json['sale']), + 'previews': json['previews'] == null ? undefined : ((json['previews'] as Array).map(ImagePreviewFromJSON)), + 'dns': json['dns'] == null ? undefined : json['dns'], 'approvedBy': json['approved_by'], }; } export function NftItemToJSON(value?: NftItem | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'address': value.address, - 'index': value.index, - 'owner': AccountAddressToJSON(value.owner), - 'collection': NftItemCollectionToJSON(value.collection), - 'verified': value.verified, - 'metadata': value.metadata, - 'sale': SaleToJSON(value.sale), - 'previews': value.previews === undefined ? undefined : ((value.previews as Array).map(ImagePreviewToJSON)), - 'dns': value.dns, - 'approved_by': value.approvedBy, + 'address': value['address'], + 'index': value['index'], + 'owner': AccountAddressToJSON(value['owner']), + 'collection': NftItemCollectionToJSON(value['collection']), + 'verified': value['verified'], + 'metadata': value['metadata'], + 'sale': SaleToJSON(value['sale']), + 'previews': value['previews'] == null ? undefined : ((value['previews'] as Array).map(ImagePreviewToJSON)), + 'dns': value['dns'], + 'approved_by': value['approvedBy'], }; } diff --git a/packages/core/src/tonApiV2/models/NftItemCollection.ts b/packages/core/src/tonApiV2/models/NftItemCollection.ts index 8d8eca3d0..e440a13a3 100644 --- a/packages/core/src/tonApiV2/models/NftItemCollection.ts +++ b/packages/core/src/tonApiV2/models/NftItemCollection.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -43,12 +43,10 @@ export interface NftItemCollection { * Check if a given object implements the NftItemCollection interface. */ export function instanceOfNftItemCollection(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "address" in value; - isInstance = isInstance && "name" in value; - isInstance = isInstance && "description" in value; - - return isInstance; + if (!('address' in value)) return false; + if (!('name' in value)) return false; + if (!('description' in value)) return false; + return true; } export function NftItemCollectionFromJSON(json: any): NftItemCollection { @@ -56,7 +54,7 @@ export function NftItemCollectionFromJSON(json: any): NftItemCollection { } export function NftItemCollectionFromJSONTyped(json: any, ignoreDiscriminator: boolean): NftItemCollection { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -68,17 +66,14 @@ export function NftItemCollectionFromJSONTyped(json: any, ignoreDiscriminator: b } export function NftItemCollectionToJSON(value?: NftItemCollection | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'address': value.address, - 'name': value.name, - 'description': value.description, + 'address': value['address'], + 'name': value['name'], + 'description': value['description'], }; } diff --git a/packages/core/src/tonApiV2/models/NftItemTransferAction.ts b/packages/core/src/tonApiV2/models/NftItemTransferAction.ts index 8a5488e75..a8aee22e7 100644 --- a/packages/core/src/tonApiV2/models/NftItemTransferAction.ts +++ b/packages/core/src/tonApiV2/models/NftItemTransferAction.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { AccountAddress } from './AccountAddress'; import { AccountAddressFromJSON, @@ -86,10 +86,8 @@ export interface NftItemTransferAction { * Check if a given object implements the NftItemTransferAction interface. */ export function instanceOfNftItemTransferAction(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "nft" in value; - - return isInstance; + if (!('nft' in value)) return false; + return true; } export function NftItemTransferActionFromJSON(json: any): NftItemTransferAction { @@ -97,37 +95,34 @@ export function NftItemTransferActionFromJSON(json: any): NftItemTransferAction } export function NftItemTransferActionFromJSONTyped(json: any, ignoreDiscriminator: boolean): NftItemTransferAction { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { - 'sender': !exists(json, 'sender') ? undefined : AccountAddressFromJSON(json['sender']), - 'recipient': !exists(json, 'recipient') ? undefined : AccountAddressFromJSON(json['recipient']), + 'sender': json['sender'] == null ? undefined : AccountAddressFromJSON(json['sender']), + 'recipient': json['recipient'] == null ? undefined : AccountAddressFromJSON(json['recipient']), 'nft': json['nft'], - 'comment': !exists(json, 'comment') ? undefined : json['comment'], - 'encryptedComment': !exists(json, 'encrypted_comment') ? undefined : EncryptedCommentFromJSON(json['encrypted_comment']), - 'payload': !exists(json, 'payload') ? undefined : json['payload'], - 'refund': !exists(json, 'refund') ? undefined : RefundFromJSON(json['refund']), + 'comment': json['comment'] == null ? undefined : json['comment'], + 'encryptedComment': json['encrypted_comment'] == null ? undefined : EncryptedCommentFromJSON(json['encrypted_comment']), + 'payload': json['payload'] == null ? undefined : json['payload'], + 'refund': json['refund'] == null ? undefined : RefundFromJSON(json['refund']), }; } export function NftItemTransferActionToJSON(value?: NftItemTransferAction | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'sender': AccountAddressToJSON(value.sender), - 'recipient': AccountAddressToJSON(value.recipient), - 'nft': value.nft, - 'comment': value.comment, - 'encrypted_comment': EncryptedCommentToJSON(value.encryptedComment), - 'payload': value.payload, - 'refund': RefundToJSON(value.refund), + 'sender': AccountAddressToJSON(value['sender']), + 'recipient': AccountAddressToJSON(value['recipient']), + 'nft': value['nft'], + 'comment': value['comment'], + 'encrypted_comment': EncryptedCommentToJSON(value['encryptedComment']), + 'payload': value['payload'], + 'refund': RefundToJSON(value['refund']), }; } diff --git a/packages/core/src/tonApiV2/models/NftItems.ts b/packages/core/src/tonApiV2/models/NftItems.ts index a4d4e758c..0e28c4ce3 100644 --- a/packages/core/src/tonApiV2/models/NftItems.ts +++ b/packages/core/src/tonApiV2/models/NftItems.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { NftItem } from './NftItem'; import { NftItemFromJSON, @@ -38,10 +38,8 @@ export interface NftItems { * Check if a given object implements the NftItems interface. */ export function instanceOfNftItems(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "nftItems" in value; - - return isInstance; + if (!('nftItems' in value)) return false; + return true; } export function NftItemsFromJSON(json: any): NftItems { @@ -49,7 +47,7 @@ export function NftItemsFromJSON(json: any): NftItems { } export function NftItemsFromJSONTyped(json: any, ignoreDiscriminator: boolean): NftItems { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -59,15 +57,12 @@ export function NftItemsFromJSONTyped(json: any, ignoreDiscriminator: boolean): } export function NftItemsToJSON(value?: NftItems | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'nft_items': ((value.nftItems as Array).map(NftItemToJSON)), + 'nft_items': ((value['nftItems'] as Array).map(NftItemToJSON)), }; } diff --git a/packages/core/src/tonApiV2/models/NftPurchaseAction.ts b/packages/core/src/tonApiV2/models/NftPurchaseAction.ts index 70571c432..40817f80c 100644 --- a/packages/core/src/tonApiV2/models/NftPurchaseAction.ts +++ b/packages/core/src/tonApiV2/models/NftPurchaseAction.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { AccountAddress } from './AccountAddress'; import { AccountAddressFromJSON, @@ -75,9 +75,10 @@ export interface NftPurchaseAction { * @export */ export const NftPurchaseActionAuctionTypeEnum = { + DnsTon: 'DNS.ton', DnsTg: 'DNS.tg', - Getgems: 'getgems', - Basic: 'basic' + NumberTg: 'NUMBER.tg', + Getgems: 'getgems' } as const; export type NftPurchaseActionAuctionTypeEnum = typeof NftPurchaseActionAuctionTypeEnum[keyof typeof NftPurchaseActionAuctionTypeEnum]; @@ -86,14 +87,12 @@ export type NftPurchaseActionAuctionTypeEnum = typeof NftPurchaseActionAuctionTy * Check if a given object implements the NftPurchaseAction interface. */ export function instanceOfNftPurchaseAction(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "auctionType" in value; - isInstance = isInstance && "amount" in value; - isInstance = isInstance && "nft" in value; - isInstance = isInstance && "seller" in value; - isInstance = isInstance && "buyer" in value; - - return isInstance; + if (!('auctionType' in value)) return false; + if (!('amount' in value)) return false; + if (!('nft' in value)) return false; + if (!('seller' in value)) return false; + if (!('buyer' in value)) return false; + return true; } export function NftPurchaseActionFromJSON(json: any): NftPurchaseAction { @@ -101,7 +100,7 @@ export function NftPurchaseActionFromJSON(json: any): NftPurchaseAction { } export function NftPurchaseActionFromJSONTyped(json: any, ignoreDiscriminator: boolean): NftPurchaseAction { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -115,19 +114,16 @@ export function NftPurchaseActionFromJSONTyped(json: any, ignoreDiscriminator: b } export function NftPurchaseActionToJSON(value?: NftPurchaseAction | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'auction_type': value.auctionType, - 'amount': PriceToJSON(value.amount), - 'nft': NftItemToJSON(value.nft), - 'seller': AccountAddressToJSON(value.seller), - 'buyer': AccountAddressToJSON(value.buyer), + 'auction_type': value['auctionType'], + 'amount': PriceToJSON(value['amount']), + 'nft': NftItemToJSON(value['nft']), + 'seller': AccountAddressToJSON(value['seller']), + 'buyer': AccountAddressToJSON(value['buyer']), }; } diff --git a/packages/core/src/tonApiV2/models/Oracle.ts b/packages/core/src/tonApiV2/models/Oracle.ts index c22d8a7c8..4ef5b3aca 100644 --- a/packages/core/src/tonApiV2/models/Oracle.ts +++ b/packages/core/src/tonApiV2/models/Oracle.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -37,11 +37,9 @@ export interface Oracle { * Check if a given object implements the Oracle interface. */ export function instanceOfOracle(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "address" in value; - isInstance = isInstance && "secpPubkey" in value; - - return isInstance; + if (!('address' in value)) return false; + if (!('secpPubkey' in value)) return false; + return true; } export function OracleFromJSON(json: any): Oracle { @@ -49,7 +47,7 @@ export function OracleFromJSON(json: any): Oracle { } export function OracleFromJSONTyped(json: any, ignoreDiscriminator: boolean): Oracle { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -60,16 +58,13 @@ export function OracleFromJSONTyped(json: any, ignoreDiscriminator: boolean): Or } export function OracleToJSON(value?: Oracle | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'address': value.address, - 'secp_pubkey': value.secpPubkey, + 'address': value['address'], + 'secp_pubkey': value['secpPubkey'], }; } diff --git a/packages/core/src/tonApiV2/models/OracleBridgeParams.ts b/packages/core/src/tonApiV2/models/OracleBridgeParams.ts index d0f446c58..0b7eeea38 100644 --- a/packages/core/src/tonApiV2/models/OracleBridgeParams.ts +++ b/packages/core/src/tonApiV2/models/OracleBridgeParams.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { Oracle } from './Oracle'; import { OracleFromJSON, @@ -56,13 +56,11 @@ export interface OracleBridgeParams { * Check if a given object implements the OracleBridgeParams interface. */ export function instanceOfOracleBridgeParams(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "bridgeAddr" in value; - isInstance = isInstance && "oracleMultisigAddress" in value; - isInstance = isInstance && "externalChainAddress" in value; - isInstance = isInstance && "oracles" in value; - - return isInstance; + if (!('bridgeAddr' in value)) return false; + if (!('oracleMultisigAddress' in value)) return false; + if (!('externalChainAddress' in value)) return false; + if (!('oracles' in value)) return false; + return true; } export function OracleBridgeParamsFromJSON(json: any): OracleBridgeParams { @@ -70,7 +68,7 @@ export function OracleBridgeParamsFromJSON(json: any): OracleBridgeParams { } export function OracleBridgeParamsFromJSONTyped(json: any, ignoreDiscriminator: boolean): OracleBridgeParams { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -83,18 +81,15 @@ export function OracleBridgeParamsFromJSONTyped(json: any, ignoreDiscriminator: } export function OracleBridgeParamsToJSON(value?: OracleBridgeParams | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'bridge_addr': value.bridgeAddr, - 'oracle_multisig_address': value.oracleMultisigAddress, - 'external_chain_address': value.externalChainAddress, - 'oracles': ((value.oracles as Array).map(OracleToJSON)), + 'bridge_addr': value['bridgeAddr'], + 'oracle_multisig_address': value['oracleMultisigAddress'], + 'external_chain_address': value['externalChainAddress'], + 'oracles': ((value['oracles'] as Array).map(OracleToJSON)), }; } diff --git a/packages/core/src/tonApiV2/models/PoolImplementation.ts b/packages/core/src/tonApiV2/models/PoolImplementation.ts index 53c82942c..33691fbcd 100644 --- a/packages/core/src/tonApiV2/models/PoolImplementation.ts +++ b/packages/core/src/tonApiV2/models/PoolImplementation.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -49,13 +49,11 @@ export interface PoolImplementation { * Check if a given object implements the PoolImplementation interface. */ export function instanceOfPoolImplementation(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "name" in value; - isInstance = isInstance && "description" in value; - isInstance = isInstance && "url" in value; - isInstance = isInstance && "socials" in value; - - return isInstance; + if (!('name' in value)) return false; + if (!('description' in value)) return false; + if (!('url' in value)) return false; + if (!('socials' in value)) return false; + return true; } export function PoolImplementationFromJSON(json: any): PoolImplementation { @@ -63,7 +61,7 @@ export function PoolImplementationFromJSON(json: any): PoolImplementation { } export function PoolImplementationFromJSONTyped(json: any, ignoreDiscriminator: boolean): PoolImplementation { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -76,18 +74,15 @@ export function PoolImplementationFromJSONTyped(json: any, ignoreDiscriminator: } export function PoolImplementationToJSON(value?: PoolImplementation | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'name': value.name, - 'description': value.description, - 'url': value.url, - 'socials': value.socials, + 'name': value['name'], + 'description': value['description'], + 'url': value['url'], + 'socials': value['socials'], }; } diff --git a/packages/core/src/tonApiV2/models/PoolInfo.ts b/packages/core/src/tonApiV2/models/PoolInfo.ts index 309242b35..503fe7626 100644 --- a/packages/core/src/tonApiV2/models/PoolInfo.ts +++ b/packages/core/src/tonApiV2/models/PoolInfo.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { PoolImplementationType } from './PoolImplementationType'; import { PoolImplementationTypeFromJSON, @@ -122,22 +122,20 @@ export interface PoolInfo { * Check if a given object implements the PoolInfo interface. */ export function instanceOfPoolInfo(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "address" in value; - isInstance = isInstance && "name" in value; - isInstance = isInstance && "totalAmount" in value; - isInstance = isInstance && "implementation" in value; - isInstance = isInstance && "apy" in value; - isInstance = isInstance && "minStake" in value; - isInstance = isInstance && "cycleStart" in value; - isInstance = isInstance && "cycleEnd" in value; - isInstance = isInstance && "verified" in value; - isInstance = isInstance && "currentNominators" in value; - isInstance = isInstance && "maxNominators" in value; - isInstance = isInstance && "nominatorsStake" in value; - isInstance = isInstance && "validatorStake" in value; - - return isInstance; + if (!('address' in value)) return false; + if (!('name' in value)) return false; + if (!('totalAmount' in value)) return false; + if (!('implementation' in value)) return false; + if (!('apy' in value)) return false; + if (!('minStake' in value)) return false; + if (!('cycleStart' in value)) return false; + if (!('cycleEnd' in value)) return false; + if (!('verified' in value)) return false; + if (!('currentNominators' in value)) return false; + if (!('maxNominators' in value)) return false; + if (!('nominatorsStake' in value)) return false; + if (!('validatorStake' in value)) return false; + return true; } export function PoolInfoFromJSON(json: any): PoolInfo { @@ -145,7 +143,7 @@ export function PoolInfoFromJSON(json: any): PoolInfo { } export function PoolInfoFromJSONTyped(json: any, ignoreDiscriminator: boolean): PoolInfo { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -161,37 +159,34 @@ export function PoolInfoFromJSONTyped(json: any, ignoreDiscriminator: boolean): 'verified': json['verified'], 'currentNominators': json['current_nominators'], 'maxNominators': json['max_nominators'], - 'liquidJettonMaster': !exists(json, 'liquid_jetton_master') ? undefined : json['liquid_jetton_master'], + 'liquidJettonMaster': json['liquid_jetton_master'] == null ? undefined : json['liquid_jetton_master'], 'nominatorsStake': json['nominators_stake'], 'validatorStake': json['validator_stake'], - 'cycleLength': !exists(json, 'cycle_length') ? undefined : json['cycle_length'], + 'cycleLength': json['cycle_length'] == null ? undefined : json['cycle_length'], }; } export function PoolInfoToJSON(value?: PoolInfo | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'address': value.address, - 'name': value.name, - 'total_amount': value.totalAmount, - 'implementation': PoolImplementationTypeToJSON(value.implementation), - 'apy': value.apy, - 'min_stake': value.minStake, - 'cycle_start': value.cycleStart, - 'cycle_end': value.cycleEnd, - 'verified': value.verified, - 'current_nominators': value.currentNominators, - 'max_nominators': value.maxNominators, - 'liquid_jetton_master': value.liquidJettonMaster, - 'nominators_stake': value.nominatorsStake, - 'validator_stake': value.validatorStake, - 'cycle_length': value.cycleLength, + 'address': value['address'], + 'name': value['name'], + 'total_amount': value['totalAmount'], + 'implementation': PoolImplementationTypeToJSON(value['implementation']), + 'apy': value['apy'], + 'min_stake': value['minStake'], + 'cycle_start': value['cycleStart'], + 'cycle_end': value['cycleEnd'], + 'verified': value['verified'], + 'current_nominators': value['currentNominators'], + 'max_nominators': value['maxNominators'], + 'liquid_jetton_master': value['liquidJettonMaster'], + 'nominators_stake': value['nominatorsStake'], + 'validator_stake': value['validatorStake'], + 'cycle_length': value['cycleLength'], }; } diff --git a/packages/core/src/tonApiV2/models/Price.ts b/packages/core/src/tonApiV2/models/Price.ts index 03e661bd6..67c5e714a 100644 --- a/packages/core/src/tonApiV2/models/Price.ts +++ b/packages/core/src/tonApiV2/models/Price.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -37,11 +37,9 @@ export interface Price { * Check if a given object implements the Price interface. */ export function instanceOfPrice(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "value" in value; - isInstance = isInstance && "tokenName" in value; - - return isInstance; + if (!('value' in value)) return false; + if (!('tokenName' in value)) return false; + return true; } export function PriceFromJSON(json: any): Price { @@ -49,7 +47,7 @@ export function PriceFromJSON(json: any): Price { } export function PriceFromJSONTyped(json: any, ignoreDiscriminator: boolean): Price { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -60,16 +58,13 @@ export function PriceFromJSONTyped(json: any, ignoreDiscriminator: boolean): Pri } export function PriceToJSON(value?: Price | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'value': value.value, - 'token_name': value.tokenName, + 'value': value['value'], + 'token_name': value['tokenName'], }; } diff --git a/packages/core/src/tonApiV2/models/RawBlockchainConfig.ts b/packages/core/src/tonApiV2/models/RawBlockchainConfig.ts index 030b8a18f..b72370033 100644 --- a/packages/core/src/tonApiV2/models/RawBlockchainConfig.ts +++ b/packages/core/src/tonApiV2/models/RawBlockchainConfig.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -31,10 +31,8 @@ export interface RawBlockchainConfig { * Check if a given object implements the RawBlockchainConfig interface. */ export function instanceOfRawBlockchainConfig(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "config" in value; - - return isInstance; + if (!('config' in value)) return false; + return true; } export function RawBlockchainConfigFromJSON(json: any): RawBlockchainConfig { @@ -42,7 +40,7 @@ export function RawBlockchainConfigFromJSON(json: any): RawBlockchainConfig { } export function RawBlockchainConfigFromJSONTyped(json: any, ignoreDiscriminator: boolean): RawBlockchainConfig { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -52,15 +50,12 @@ export function RawBlockchainConfigFromJSONTyped(json: any, ignoreDiscriminator: } export function RawBlockchainConfigToJSON(value?: RawBlockchainConfig | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'config': value.config, + 'config': value['config'], }; } diff --git a/packages/core/src/tonApiV2/models/ReduceIndexingLatencyDefaultResponse.ts b/packages/core/src/tonApiV2/models/ReduceIndexingLatencyDefaultResponse.ts new file mode 100644 index 000000000..e07d049dd --- /dev/null +++ b/packages/core/src/tonApiV2/models/ReduceIndexingLatencyDefaultResponse.ts @@ -0,0 +1,61 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * REST api to TON blockchain explorer + * Provide access to indexed TON blockchain + * + * The version of the OpenAPI document: 2.0.0 + * Contact: support@tonkeeper.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface ReduceIndexingLatencyDefaultResponse + */ +export interface ReduceIndexingLatencyDefaultResponse { + /** + * + * @type {string} + * @memberof ReduceIndexingLatencyDefaultResponse + */ + error: string; +} + +/** + * Check if a given object implements the ReduceIndexingLatencyDefaultResponse interface. + */ +export function instanceOfReduceIndexingLatencyDefaultResponse(value: object): boolean { + if (!('error' in value)) return false; + return true; +} + +export function ReduceIndexingLatencyDefaultResponseFromJSON(json: any): ReduceIndexingLatencyDefaultResponse { + return ReduceIndexingLatencyDefaultResponseFromJSONTyped(json, false); +} + +export function ReduceIndexingLatencyDefaultResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): ReduceIndexingLatencyDefaultResponse { + if (json == null) { + return json; + } + return { + + 'error': json['error'], + }; +} + +export function ReduceIndexingLatencyDefaultResponseToJSON(value?: ReduceIndexingLatencyDefaultResponse | null): any { + if (value == null) { + return value; + } + return { + + 'error': value['error'], + }; +} + diff --git a/packages/core/src/tonApiV2/models/Refund.ts b/packages/core/src/tonApiV2/models/Refund.ts index 2f9fcf6a6..cd0f49a08 100644 --- a/packages/core/src/tonApiV2/models/Refund.ts +++ b/packages/core/src/tonApiV2/models/Refund.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -49,11 +49,9 @@ export type RefundTypeEnum = typeof RefundTypeEnum[keyof typeof RefundTypeEnum]; * Check if a given object implements the Refund interface. */ export function instanceOfRefund(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "type" in value; - isInstance = isInstance && "origin" in value; - - return isInstance; + if (!('type' in value)) return false; + if (!('origin' in value)) return false; + return true; } export function RefundFromJSON(json: any): Refund { @@ -61,7 +59,7 @@ export function RefundFromJSON(json: any): Refund { } export function RefundFromJSONTyped(json: any, ignoreDiscriminator: boolean): Refund { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -72,16 +70,13 @@ export function RefundFromJSONTyped(json: any, ignoreDiscriminator: boolean): Re } export function RefundToJSON(value?: Refund | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'type': value.type, - 'origin': value.origin, + 'type': value['type'], + 'origin': value['origin'], }; } diff --git a/packages/core/src/tonApiV2/models/Risk.ts b/packages/core/src/tonApiV2/models/Risk.ts index f499d7abb..23c079b85 100644 --- a/packages/core/src/tonApiV2/models/Risk.ts +++ b/packages/core/src/tonApiV2/models/Risk.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { JettonQuantity } from './JettonQuantity'; import { JettonQuantityFromJSON, @@ -62,13 +62,11 @@ export interface Risk { * Check if a given object implements the Risk interface. */ export function instanceOfRisk(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "transferAllRemainingBalance" in value; - isInstance = isInstance && "ton" in value; - isInstance = isInstance && "jettons" in value; - isInstance = isInstance && "nfts" in value; - - return isInstance; + if (!('transferAllRemainingBalance' in value)) return false; + if (!('ton' in value)) return false; + if (!('jettons' in value)) return false; + if (!('nfts' in value)) return false; + return true; } export function RiskFromJSON(json: any): Risk { @@ -76,7 +74,7 @@ export function RiskFromJSON(json: any): Risk { } export function RiskFromJSONTyped(json: any, ignoreDiscriminator: boolean): Risk { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -89,18 +87,15 @@ export function RiskFromJSONTyped(json: any, ignoreDiscriminator: boolean): Risk } export function RiskToJSON(value?: Risk | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'transfer_all_remaining_balance': value.transferAllRemainingBalance, - 'ton': value.ton, - 'jettons': ((value.jettons as Array).map(JettonQuantityToJSON)), - 'nfts': ((value.nfts as Array).map(NftItemToJSON)), + 'transfer_all_remaining_balance': value['transferAllRemainingBalance'], + 'ton': value['ton'], + 'jettons': ((value['jettons'] as Array).map(JettonQuantityToJSON)), + 'nfts': ((value['nfts'] as Array).map(NftItemToJSON)), }; } diff --git a/packages/core/src/tonApiV2/models/Sale.ts b/packages/core/src/tonApiV2/models/Sale.ts index 99a05d23e..8974251c9 100644 --- a/packages/core/src/tonApiV2/models/Sale.ts +++ b/packages/core/src/tonApiV2/models/Sale.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { AccountAddress } from './AccountAddress'; import { AccountAddressFromJSON, @@ -62,12 +62,10 @@ export interface Sale { * Check if a given object implements the Sale interface. */ export function instanceOfSale(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "address" in value; - isInstance = isInstance && "market" in value; - isInstance = isInstance && "price" in value; - - return isInstance; + if (!('address' in value)) return false; + if (!('market' in value)) return false; + if (!('price' in value)) return false; + return true; } export function SaleFromJSON(json: any): Sale { @@ -75,31 +73,28 @@ export function SaleFromJSON(json: any): Sale { } export function SaleFromJSONTyped(json: any, ignoreDiscriminator: boolean): Sale { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'address': json['address'], 'market': AccountAddressFromJSON(json['market']), - 'owner': !exists(json, 'owner') ? undefined : AccountAddressFromJSON(json['owner']), + 'owner': json['owner'] == null ? undefined : AccountAddressFromJSON(json['owner']), 'price': PriceFromJSON(json['price']), }; } export function SaleToJSON(value?: Sale | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'address': value.address, - 'market': AccountAddressToJSON(value.market), - 'owner': AccountAddressToJSON(value.owner), - 'price': PriceToJSON(value.price), + 'address': value['address'], + 'market': AccountAddressToJSON(value['market']), + 'owner': AccountAddressToJSON(value['owner']), + 'price': PriceToJSON(value['price']), }; } diff --git a/packages/core/src/tonApiV2/models/SendBlockchainMessageRequest.ts b/packages/core/src/tonApiV2/models/SendBlockchainMessageRequest.ts index 61487b3d3..2ebc2f7f7 100644 --- a/packages/core/src/tonApiV2/models/SendBlockchainMessageRequest.ts +++ b/packages/core/src/tonApiV2/models/SendBlockchainMessageRequest.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -37,9 +37,7 @@ export interface SendBlockchainMessageRequest { * Check if a given object implements the SendBlockchainMessageRequest interface. */ export function instanceOfSendBlockchainMessageRequest(value: object): boolean { - let isInstance = true; - - return isInstance; + return true; } export function SendBlockchainMessageRequestFromJSON(json: any): SendBlockchainMessageRequest { @@ -47,27 +45,24 @@ export function SendBlockchainMessageRequestFromJSON(json: any): SendBlockchainM } export function SendBlockchainMessageRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): SendBlockchainMessageRequest { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { - 'boc': !exists(json, 'boc') ? undefined : json['boc'], - 'batch': !exists(json, 'batch') ? undefined : json['batch'], + 'boc': json['boc'] == null ? undefined : json['boc'], + 'batch': json['batch'] == null ? undefined : json['batch'], }; } export function SendBlockchainMessageRequestToJSON(value?: SendBlockchainMessageRequest | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'boc': value.boc, - 'batch': value.batch, + 'boc': value['boc'], + 'batch': value['batch'], }; } diff --git a/packages/core/src/tonApiV2/models/SendRawMessage200Response.ts b/packages/core/src/tonApiV2/models/SendRawMessage200Response.ts index 36fdaef40..81aba117d 100644 --- a/packages/core/src/tonApiV2/models/SendRawMessage200Response.ts +++ b/packages/core/src/tonApiV2/models/SendRawMessage200Response.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -31,10 +31,8 @@ export interface SendRawMessage200Response { * Check if a given object implements the SendRawMessage200Response interface. */ export function instanceOfSendRawMessage200Response(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "code" in value; - - return isInstance; + if (!('code' in value)) return false; + return true; } export function SendRawMessage200ResponseFromJSON(json: any): SendRawMessage200Response { @@ -42,7 +40,7 @@ export function SendRawMessage200ResponseFromJSON(json: any): SendRawMessage200R } export function SendRawMessage200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): SendRawMessage200Response { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -52,15 +50,12 @@ export function SendRawMessage200ResponseFromJSONTyped(json: any, ignoreDiscrimi } export function SendRawMessage200ResponseToJSON(value?: SendRawMessage200Response | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'code': value.code, + 'code': value['code'], }; } diff --git a/packages/core/src/tonApiV2/models/SendRawMessageRequest.ts b/packages/core/src/tonApiV2/models/SendRawMessageRequest.ts index 430bf1a9d..093256256 100644 --- a/packages/core/src/tonApiV2/models/SendRawMessageRequest.ts +++ b/packages/core/src/tonApiV2/models/SendRawMessageRequest.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -31,10 +31,8 @@ export interface SendRawMessageRequest { * Check if a given object implements the SendRawMessageRequest interface. */ export function instanceOfSendRawMessageRequest(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "body" in value; - - return isInstance; + if (!('body' in value)) return false; + return true; } export function SendRawMessageRequestFromJSON(json: any): SendRawMessageRequest { @@ -42,7 +40,7 @@ export function SendRawMessageRequestFromJSON(json: any): SendRawMessageRequest } export function SendRawMessageRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): SendRawMessageRequest { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -52,15 +50,12 @@ export function SendRawMessageRequestFromJSONTyped(json: any, ignoreDiscriminato } export function SendRawMessageRequestToJSON(value?: SendRawMessageRequest | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'body': value.body, + 'body': value['body'], }; } diff --git a/packages/core/src/tonApiV2/models/Seqno.ts b/packages/core/src/tonApiV2/models/Seqno.ts index 0a29f48df..d6aff866f 100644 --- a/packages/core/src/tonApiV2/models/Seqno.ts +++ b/packages/core/src/tonApiV2/models/Seqno.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -31,10 +31,8 @@ export interface Seqno { * Check if a given object implements the Seqno interface. */ export function instanceOfSeqno(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "seqno" in value; - - return isInstance; + if (!('seqno' in value)) return false; + return true; } export function SeqnoFromJSON(json: any): Seqno { @@ -42,7 +40,7 @@ export function SeqnoFromJSON(json: any): Seqno { } export function SeqnoFromJSONTyped(json: any, ignoreDiscriminator: boolean): Seqno { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -52,15 +50,12 @@ export function SeqnoFromJSONTyped(json: any, ignoreDiscriminator: boolean): Seq } export function SeqnoToJSON(value?: Seqno | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'seqno': value.seqno, + 'seqno': value['seqno'], }; } diff --git a/packages/core/src/tonApiV2/models/ServiceStatus.ts b/packages/core/src/tonApiV2/models/ServiceStatus.ts new file mode 100644 index 000000000..71214e898 --- /dev/null +++ b/packages/core/src/tonApiV2/models/ServiceStatus.ts @@ -0,0 +1,70 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * REST api to TON blockchain explorer + * Provide access to indexed TON blockchain + * + * The version of the OpenAPI document: 2.0.0 + * Contact: support@tonkeeper.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface ServiceStatus + */ +export interface ServiceStatus { + /** + * + * @type {boolean} + * @memberof ServiceStatus + */ + restOnline: boolean; + /** + * + * @type {number} + * @memberof ServiceStatus + */ + indexingLatency: number; +} + +/** + * Check if a given object implements the ServiceStatus interface. + */ +export function instanceOfServiceStatus(value: object): boolean { + if (!('restOnline' in value)) return false; + if (!('indexingLatency' in value)) return false; + return true; +} + +export function ServiceStatusFromJSON(json: any): ServiceStatus { + return ServiceStatusFromJSONTyped(json, false); +} + +export function ServiceStatusFromJSONTyped(json: any, ignoreDiscriminator: boolean): ServiceStatus { + if (json == null) { + return json; + } + return { + + 'restOnline': json['rest_online'], + 'indexingLatency': json['indexing_latency'], + }; +} + +export function ServiceStatusToJSON(value?: ServiceStatus | null): any { + if (value == null) { + return value; + } + return { + + 'rest_online': value['restOnline'], + 'indexing_latency': value['indexingLatency'], + }; +} + diff --git a/packages/core/src/tonApiV2/models/SizeLimitsConfig.ts b/packages/core/src/tonApiV2/models/SizeLimitsConfig.ts index 2a7bd3d3d..054f0db48 100644 --- a/packages/core/src/tonApiV2/models/SizeLimitsConfig.ts +++ b/packages/core/src/tonApiV2/models/SizeLimitsConfig.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -73,15 +73,13 @@ export interface SizeLimitsConfig { * Check if a given object implements the SizeLimitsConfig interface. */ export function instanceOfSizeLimitsConfig(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "maxMsgBits" in value; - isInstance = isInstance && "maxMsgCells" in value; - isInstance = isInstance && "maxLibraryCells" in value; - isInstance = isInstance && "maxVmDataDepth" in value; - isInstance = isInstance && "maxExtMsgSize" in value; - isInstance = isInstance && "maxExtMsgDepth" in value; - - return isInstance; + if (!('maxMsgBits' in value)) return false; + if (!('maxMsgCells' in value)) return false; + if (!('maxLibraryCells' in value)) return false; + if (!('maxVmDataDepth' in value)) return false; + if (!('maxExtMsgSize' in value)) return false; + if (!('maxExtMsgDepth' in value)) return false; + return true; } export function SizeLimitsConfigFromJSON(json: any): SizeLimitsConfig { @@ -89,7 +87,7 @@ export function SizeLimitsConfigFromJSON(json: any): SizeLimitsConfig { } export function SizeLimitsConfigFromJSONTyped(json: any, ignoreDiscriminator: boolean): SizeLimitsConfig { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -100,28 +98,25 @@ export function SizeLimitsConfigFromJSONTyped(json: any, ignoreDiscriminator: bo 'maxVmDataDepth': json['max_vm_data_depth'], 'maxExtMsgSize': json['max_ext_msg_size'], 'maxExtMsgDepth': json['max_ext_msg_depth'], - 'maxAccStateCells': !exists(json, 'max_acc_state_cells') ? undefined : json['max_acc_state_cells'], - 'maxAccStateBits': !exists(json, 'max_acc_state_bits') ? undefined : json['max_acc_state_bits'], + 'maxAccStateCells': json['max_acc_state_cells'] == null ? undefined : json['max_acc_state_cells'], + 'maxAccStateBits': json['max_acc_state_bits'] == null ? undefined : json['max_acc_state_bits'], }; } export function SizeLimitsConfigToJSON(value?: SizeLimitsConfig | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'max_msg_bits': value.maxMsgBits, - 'max_msg_cells': value.maxMsgCells, - 'max_library_cells': value.maxLibraryCells, - 'max_vm_data_depth': value.maxVmDataDepth, - 'max_ext_msg_size': value.maxExtMsgSize, - 'max_ext_msg_depth': value.maxExtMsgDepth, - 'max_acc_state_cells': value.maxAccStateCells, - 'max_acc_state_bits': value.maxAccStateBits, + 'max_msg_bits': value['maxMsgBits'], + 'max_msg_cells': value['maxMsgCells'], + 'max_library_cells': value['maxLibraryCells'], + 'max_vm_data_depth': value['maxVmDataDepth'], + 'max_ext_msg_size': value['maxExtMsgSize'], + 'max_ext_msg_depth': value['maxExtMsgDepth'], + 'max_acc_state_cells': value['maxAccStateCells'], + 'max_acc_state_bits': value['maxAccStateBits'], }; } diff --git a/packages/core/src/tonApiV2/models/SmartContractAction.ts b/packages/core/src/tonApiV2/models/SmartContractAction.ts index 76c34a736..65cb78eab 100644 --- a/packages/core/src/tonApiV2/models/SmartContractAction.ts +++ b/packages/core/src/tonApiV2/models/SmartContractAction.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { AccountAddress } from './AccountAddress'; import { AccountAddressFromJSON, @@ -74,13 +74,11 @@ export interface SmartContractAction { * Check if a given object implements the SmartContractAction interface. */ export function instanceOfSmartContractAction(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "executor" in value; - isInstance = isInstance && "contract" in value; - isInstance = isInstance && "tonAttached" in value; - isInstance = isInstance && "operation" in value; - - return isInstance; + if (!('executor' in value)) return false; + if (!('contract' in value)) return false; + if (!('tonAttached' in value)) return false; + if (!('operation' in value)) return false; + return true; } export function SmartContractActionFromJSON(json: any): SmartContractAction { @@ -88,7 +86,7 @@ export function SmartContractActionFromJSON(json: any): SmartContractAction { } export function SmartContractActionFromJSONTyped(json: any, ignoreDiscriminator: boolean): SmartContractAction { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -97,26 +95,23 @@ export function SmartContractActionFromJSONTyped(json: any, ignoreDiscriminator: 'contract': AccountAddressFromJSON(json['contract']), 'tonAttached': json['ton_attached'], 'operation': json['operation'], - 'payload': !exists(json, 'payload') ? undefined : json['payload'], - 'refund': !exists(json, 'refund') ? undefined : RefundFromJSON(json['refund']), + 'payload': json['payload'] == null ? undefined : json['payload'], + 'refund': json['refund'] == null ? undefined : RefundFromJSON(json['refund']), }; } export function SmartContractActionToJSON(value?: SmartContractAction | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'executor': AccountAddressToJSON(value.executor), - 'contract': AccountAddressToJSON(value.contract), - 'ton_attached': value.tonAttached, - 'operation': value.operation, - 'payload': value.payload, - 'refund': RefundToJSON(value.refund), + 'executor': AccountAddressToJSON(value['executor']), + 'contract': AccountAddressToJSON(value['contract']), + 'ton_attached': value['tonAttached'], + 'operation': value['operation'], + 'payload': value['payload'], + 'refund': RefundToJSON(value['refund']), }; } diff --git a/packages/core/src/tonApiV2/models/StateInit.ts b/packages/core/src/tonApiV2/models/StateInit.ts index a8251b2bc..d93042002 100644 --- a/packages/core/src/tonApiV2/models/StateInit.ts +++ b/packages/core/src/tonApiV2/models/StateInit.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -31,10 +31,8 @@ export interface StateInit { * Check if a given object implements the StateInit interface. */ export function instanceOfStateInit(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "boc" in value; - - return isInstance; + if (!('boc' in value)) return false; + return true; } export function StateInitFromJSON(json: any): StateInit { @@ -42,7 +40,7 @@ export function StateInitFromJSON(json: any): StateInit { } export function StateInitFromJSONTyped(json: any, ignoreDiscriminator: boolean): StateInit { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -52,15 +50,12 @@ export function StateInitFromJSONTyped(json: any, ignoreDiscriminator: boolean): } export function StateInitToJSON(value?: StateInit | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'boc': value.boc, + 'boc': value['boc'], }; } diff --git a/packages/core/src/tonApiV2/models/StoragePhase.ts b/packages/core/src/tonApiV2/models/StoragePhase.ts index d8b01c1d4..a096293d9 100644 --- a/packages/core/src/tonApiV2/models/StoragePhase.ts +++ b/packages/core/src/tonApiV2/models/StoragePhase.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { AccStatusChange } from './AccStatusChange'; import { AccStatusChangeFromJSON, @@ -50,11 +50,9 @@ export interface StoragePhase { * Check if a given object implements the StoragePhase interface. */ export function instanceOfStoragePhase(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "feesCollected" in value; - isInstance = isInstance && "statusChange" in value; - - return isInstance; + if (!('feesCollected' in value)) return false; + if (!('statusChange' in value)) return false; + return true; } export function StoragePhaseFromJSON(json: any): StoragePhase { @@ -62,29 +60,26 @@ export function StoragePhaseFromJSON(json: any): StoragePhase { } export function StoragePhaseFromJSONTyped(json: any, ignoreDiscriminator: boolean): StoragePhase { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'feesCollected': json['fees_collected'], - 'feesDue': !exists(json, 'fees_due') ? undefined : json['fees_due'], + 'feesDue': json['fees_due'] == null ? undefined : json['fees_due'], 'statusChange': AccStatusChangeFromJSON(json['status_change']), }; } export function StoragePhaseToJSON(value?: StoragePhase | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'fees_collected': value.feesCollected, - 'fees_due': value.feesDue, - 'status_change': AccStatusChangeToJSON(value.statusChange), + 'fees_collected': value['feesCollected'], + 'fees_due': value['feesDue'], + 'status_change': AccStatusChangeToJSON(value['statusChange']), }; } diff --git a/packages/core/src/tonApiV2/models/StorageProvider.ts b/packages/core/src/tonApiV2/models/StorageProvider.ts index 750f3861f..abb74f06f 100644 --- a/packages/core/src/tonApiV2/models/StorageProvider.ts +++ b/packages/core/src/tonApiV2/models/StorageProvider.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -61,15 +61,13 @@ export interface StorageProvider { * Check if a given object implements the StorageProvider interface. */ export function instanceOfStorageProvider(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "address" in value; - isInstance = isInstance && "acceptNewContracts" in value; - isInstance = isInstance && "ratePerMbDay" in value; - isInstance = isInstance && "maxSpan" in value; - isInstance = isInstance && "minimalFileSize" in value; - isInstance = isInstance && "maximalFileSize" in value; - - return isInstance; + if (!('address' in value)) return false; + if (!('acceptNewContracts' in value)) return false; + if (!('ratePerMbDay' in value)) return false; + if (!('maxSpan' in value)) return false; + if (!('minimalFileSize' in value)) return false; + if (!('maximalFileSize' in value)) return false; + return true; } export function StorageProviderFromJSON(json: any): StorageProvider { @@ -77,7 +75,7 @@ export function StorageProviderFromJSON(json: any): StorageProvider { } export function StorageProviderFromJSONTyped(json: any, ignoreDiscriminator: boolean): StorageProvider { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -92,20 +90,17 @@ export function StorageProviderFromJSONTyped(json: any, ignoreDiscriminator: boo } export function StorageProviderToJSON(value?: StorageProvider | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'address': value.address, - 'accept_new_contracts': value.acceptNewContracts, - 'rate_per_mb_day': value.ratePerMbDay, - 'max_span': value.maxSpan, - 'minimal_file_size': value.minimalFileSize, - 'maximal_file_size': value.maximalFileSize, + 'address': value['address'], + 'accept_new_contracts': value['acceptNewContracts'], + 'rate_per_mb_day': value['ratePerMbDay'], + 'max_span': value['maxSpan'], + 'minimal_file_size': value['minimalFileSize'], + 'maximal_file_size': value['maximalFileSize'], }; } diff --git a/packages/core/src/tonApiV2/models/Subscription.ts b/packages/core/src/tonApiV2/models/Subscription.ts index 0652dec33..2d0177eb0 100644 --- a/packages/core/src/tonApiV2/models/Subscription.ts +++ b/packages/core/src/tonApiV2/models/Subscription.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -91,20 +91,18 @@ export interface Subscription { * Check if a given object implements the Subscription interface. */ export function instanceOfSubscription(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "address" in value; - isInstance = isInstance && "walletAddress" in value; - isInstance = isInstance && "beneficiaryAddress" in value; - isInstance = isInstance && "amount" in value; - isInstance = isInstance && "period" in value; - isInstance = isInstance && "startTime" in value; - isInstance = isInstance && "timeout" in value; - isInstance = isInstance && "lastPaymentTime" in value; - isInstance = isInstance && "lastRequestTime" in value; - isInstance = isInstance && "subscriptionId" in value; - isInstance = isInstance && "failedAttempts" in value; - - return isInstance; + if (!('address' in value)) return false; + if (!('walletAddress' in value)) return false; + if (!('beneficiaryAddress' in value)) return false; + if (!('amount' in value)) return false; + if (!('period' in value)) return false; + if (!('startTime' in value)) return false; + if (!('timeout' in value)) return false; + if (!('lastPaymentTime' in value)) return false; + if (!('lastRequestTime' in value)) return false; + if (!('subscriptionId' in value)) return false; + if (!('failedAttempts' in value)) return false; + return true; } export function SubscriptionFromJSON(json: any): Subscription { @@ -112,7 +110,7 @@ export function SubscriptionFromJSON(json: any): Subscription { } export function SubscriptionFromJSONTyped(json: any, ignoreDiscriminator: boolean): Subscription { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -132,25 +130,22 @@ export function SubscriptionFromJSONTyped(json: any, ignoreDiscriminator: boolea } export function SubscriptionToJSON(value?: Subscription | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'address': value.address, - 'wallet_address': value.walletAddress, - 'beneficiary_address': value.beneficiaryAddress, - 'amount': value.amount, - 'period': value.period, - 'start_time': value.startTime, - 'timeout': value.timeout, - 'last_payment_time': value.lastPaymentTime, - 'last_request_time': value.lastRequestTime, - 'subscription_id': value.subscriptionId, - 'failed_attempts': value.failedAttempts, + 'address': value['address'], + 'wallet_address': value['walletAddress'], + 'beneficiary_address': value['beneficiaryAddress'], + 'amount': value['amount'], + 'period': value['period'], + 'start_time': value['startTime'], + 'timeout': value['timeout'], + 'last_payment_time': value['lastPaymentTime'], + 'last_request_time': value['lastRequestTime'], + 'subscription_id': value['subscriptionId'], + 'failed_attempts': value['failedAttempts'], }; } diff --git a/packages/core/src/tonApiV2/models/SubscriptionAction.ts b/packages/core/src/tonApiV2/models/SubscriptionAction.ts index 0601b1ffd..df5e68af4 100644 --- a/packages/core/src/tonApiV2/models/SubscriptionAction.ts +++ b/packages/core/src/tonApiV2/models/SubscriptionAction.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { AccountAddress } from './AccountAddress'; import { AccountAddressFromJSON, @@ -62,14 +62,12 @@ export interface SubscriptionAction { * Check if a given object implements the SubscriptionAction interface. */ export function instanceOfSubscriptionAction(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "subscriber" in value; - isInstance = isInstance && "subscription" in value; - isInstance = isInstance && "beneficiary" in value; - isInstance = isInstance && "amount" in value; - isInstance = isInstance && "initial" in value; - - return isInstance; + if (!('subscriber' in value)) return false; + if (!('subscription' in value)) return false; + if (!('beneficiary' in value)) return false; + if (!('amount' in value)) return false; + if (!('initial' in value)) return false; + return true; } export function SubscriptionActionFromJSON(json: any): SubscriptionAction { @@ -77,7 +75,7 @@ export function SubscriptionActionFromJSON(json: any): SubscriptionAction { } export function SubscriptionActionFromJSONTyped(json: any, ignoreDiscriminator: boolean): SubscriptionAction { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -91,19 +89,16 @@ export function SubscriptionActionFromJSONTyped(json: any, ignoreDiscriminator: } export function SubscriptionActionToJSON(value?: SubscriptionAction | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'subscriber': AccountAddressToJSON(value.subscriber), - 'subscription': value.subscription, - 'beneficiary': AccountAddressToJSON(value.beneficiary), - 'amount': value.amount, - 'initial': value.initial, + 'subscriber': AccountAddressToJSON(value['subscriber']), + 'subscription': value['subscription'], + 'beneficiary': AccountAddressToJSON(value['beneficiary']), + 'amount': value['amount'], + 'initial': value['initial'], }; } diff --git a/packages/core/src/tonApiV2/models/Subscriptions.ts b/packages/core/src/tonApiV2/models/Subscriptions.ts index a60aaef55..63b7cb688 100644 --- a/packages/core/src/tonApiV2/models/Subscriptions.ts +++ b/packages/core/src/tonApiV2/models/Subscriptions.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { Subscription } from './Subscription'; import { SubscriptionFromJSON, @@ -38,10 +38,8 @@ export interface Subscriptions { * Check if a given object implements the Subscriptions interface. */ export function instanceOfSubscriptions(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "subscriptions" in value; - - return isInstance; + if (!('subscriptions' in value)) return false; + return true; } export function SubscriptionsFromJSON(json: any): Subscriptions { @@ -49,7 +47,7 @@ export function SubscriptionsFromJSON(json: any): Subscriptions { } export function SubscriptionsFromJSONTyped(json: any, ignoreDiscriminator: boolean): Subscriptions { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -59,15 +57,12 @@ export function SubscriptionsFromJSONTyped(json: any, ignoreDiscriminator: boole } export function SubscriptionsToJSON(value?: Subscriptions | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'subscriptions': ((value.subscriptions as Array).map(SubscriptionToJSON)), + 'subscriptions': ((value['subscriptions'] as Array).map(SubscriptionToJSON)), }; } diff --git a/packages/core/src/tonApiV2/models/TokenRates.ts b/packages/core/src/tonApiV2/models/TokenRates.ts index b6141c634..3542dac62 100644 --- a/packages/core/src/tonApiV2/models/TokenRates.ts +++ b/packages/core/src/tonApiV2/models/TokenRates.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -49,9 +49,7 @@ export interface TokenRates { * Check if a given object implements the TokenRates interface. */ export function instanceOfTokenRates(value: object): boolean { - let isInstance = true; - - return isInstance; + return true; } export function TokenRatesFromJSON(json: any): TokenRates { @@ -59,31 +57,28 @@ export function TokenRatesFromJSON(json: any): TokenRates { } export function TokenRatesFromJSONTyped(json: any, ignoreDiscriminator: boolean): TokenRates { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { - 'prices': !exists(json, 'prices') ? undefined : json['prices'], - 'diff24h': !exists(json, 'diff_24h') ? undefined : json['diff_24h'], - 'diff7d': !exists(json, 'diff_7d') ? undefined : json['diff_7d'], - 'diff30d': !exists(json, 'diff_30d') ? undefined : json['diff_30d'], + 'prices': json['prices'] == null ? undefined : json['prices'], + 'diff24h': json['diff_24h'] == null ? undefined : json['diff_24h'], + 'diff7d': json['diff_7d'] == null ? undefined : json['diff_7d'], + 'diff30d': json['diff_30d'] == null ? undefined : json['diff_30d'], }; } export function TokenRatesToJSON(value?: TokenRates | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'prices': value.prices, - 'diff_24h': value.diff24h, - 'diff_7d': value.diff7d, - 'diff_30d': value.diff30d, + 'prices': value['prices'], + 'diff_24h': value['diff24h'], + 'diff_7d': value['diff7d'], + 'diff_30d': value['diff30d'], }; } diff --git a/packages/core/src/tonApiV2/models/TonConnectProof200Response.ts b/packages/core/src/tonApiV2/models/TonConnectProof200Response.ts index 6371a2d34..b810ca1e3 100644 --- a/packages/core/src/tonApiV2/models/TonConnectProof200Response.ts +++ b/packages/core/src/tonApiV2/models/TonConnectProof200Response.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -31,10 +31,8 @@ export interface TonConnectProof200Response { * Check if a given object implements the TonConnectProof200Response interface. */ export function instanceOfTonConnectProof200Response(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "token" in value; - - return isInstance; + if (!('token' in value)) return false; + return true; } export function TonConnectProof200ResponseFromJSON(json: any): TonConnectProof200Response { @@ -42,7 +40,7 @@ export function TonConnectProof200ResponseFromJSON(json: any): TonConnectProof20 } export function TonConnectProof200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): TonConnectProof200Response { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -52,15 +50,12 @@ export function TonConnectProof200ResponseFromJSONTyped(json: any, ignoreDiscrim } export function TonConnectProof200ResponseToJSON(value?: TonConnectProof200Response | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'token': value.token, + 'token': value['token'], }; } diff --git a/packages/core/src/tonApiV2/models/TonConnectProofRequest.ts b/packages/core/src/tonApiV2/models/TonConnectProofRequest.ts index 810055f10..e074c5313 100644 --- a/packages/core/src/tonApiV2/models/TonConnectProofRequest.ts +++ b/packages/core/src/tonApiV2/models/TonConnectProofRequest.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { TonConnectProofRequestProof } from './TonConnectProofRequestProof'; import { TonConnectProofRequestProofFromJSON, @@ -44,11 +44,9 @@ export interface TonConnectProofRequest { * Check if a given object implements the TonConnectProofRequest interface. */ export function instanceOfTonConnectProofRequest(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "address" in value; - isInstance = isInstance && "proof" in value; - - return isInstance; + if (!('address' in value)) return false; + if (!('proof' in value)) return false; + return true; } export function TonConnectProofRequestFromJSON(json: any): TonConnectProofRequest { @@ -56,7 +54,7 @@ export function TonConnectProofRequestFromJSON(json: any): TonConnectProofReques } export function TonConnectProofRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): TonConnectProofRequest { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -67,16 +65,13 @@ export function TonConnectProofRequestFromJSONTyped(json: any, ignoreDiscriminat } export function TonConnectProofRequestToJSON(value?: TonConnectProofRequest | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'address': value.address, - 'proof': TonConnectProofRequestProofToJSON(value.proof), + 'address': value['address'], + 'proof': TonConnectProofRequestProofToJSON(value['proof']), }; } diff --git a/packages/core/src/tonApiV2/models/TonConnectProofRequestProof.ts b/packages/core/src/tonApiV2/models/TonConnectProofRequestProof.ts index 15496b702..adf1cdab5 100644 --- a/packages/core/src/tonApiV2/models/TonConnectProofRequestProof.ts +++ b/packages/core/src/tonApiV2/models/TonConnectProofRequestProof.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { TonConnectProofRequestProofDomain } from './TonConnectProofRequestProofDomain'; import { TonConnectProofRequestProofDomainFromJSON, @@ -62,13 +62,11 @@ export interface TonConnectProofRequestProof { * Check if a given object implements the TonConnectProofRequestProof interface. */ export function instanceOfTonConnectProofRequestProof(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "timestamp" in value; - isInstance = isInstance && "domain" in value; - isInstance = isInstance && "signature" in value; - isInstance = isInstance && "payload" in value; - - return isInstance; + if (!('timestamp' in value)) return false; + if (!('domain' in value)) return false; + if (!('signature' in value)) return false; + if (!('payload' in value)) return false; + return true; } export function TonConnectProofRequestProofFromJSON(json: any): TonConnectProofRequestProof { @@ -76,7 +74,7 @@ export function TonConnectProofRequestProofFromJSON(json: any): TonConnectProofR } export function TonConnectProofRequestProofFromJSONTyped(json: any, ignoreDiscriminator: boolean): TonConnectProofRequestProof { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -85,24 +83,21 @@ export function TonConnectProofRequestProofFromJSONTyped(json: any, ignoreDiscri 'domain': TonConnectProofRequestProofDomainFromJSON(json['domain']), 'signature': json['signature'], 'payload': json['payload'], - 'stateInit': !exists(json, 'state_init') ? undefined : json['state_init'], + 'stateInit': json['state_init'] == null ? undefined : json['state_init'], }; } export function TonConnectProofRequestProofToJSON(value?: TonConnectProofRequestProof | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'timestamp': value.timestamp, - 'domain': TonConnectProofRequestProofDomainToJSON(value.domain), - 'signature': value.signature, - 'payload': value.payload, - 'state_init': value.stateInit, + 'timestamp': value['timestamp'], + 'domain': TonConnectProofRequestProofDomainToJSON(value['domain']), + 'signature': value['signature'], + 'payload': value['payload'], + 'state_init': value['stateInit'], }; } diff --git a/packages/core/src/tonApiV2/models/TonConnectProofRequestProofDomain.ts b/packages/core/src/tonApiV2/models/TonConnectProofRequestProofDomain.ts index 7da90a3c7..3f25b7276 100644 --- a/packages/core/src/tonApiV2/models/TonConnectProofRequestProofDomain.ts +++ b/packages/core/src/tonApiV2/models/TonConnectProofRequestProofDomain.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -37,10 +37,8 @@ export interface TonConnectProofRequestProofDomain { * Check if a given object implements the TonConnectProofRequestProofDomain interface. */ export function instanceOfTonConnectProofRequestProofDomain(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "value" in value; - - return isInstance; + if (!('value' in value)) return false; + return true; } export function TonConnectProofRequestProofDomainFromJSON(json: any): TonConnectProofRequestProofDomain { @@ -48,27 +46,24 @@ export function TonConnectProofRequestProofDomainFromJSON(json: any): TonConnect } export function TonConnectProofRequestProofDomainFromJSONTyped(json: any, ignoreDiscriminator: boolean): TonConnectProofRequestProofDomain { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { - 'lengthBytes': !exists(json, 'length_bytes') ? undefined : json['length_bytes'], + 'lengthBytes': json['length_bytes'] == null ? undefined : json['length_bytes'], 'value': json['value'], }; } export function TonConnectProofRequestProofDomainToJSON(value?: TonConnectProofRequestProofDomain | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'length_bytes': value.lengthBytes, - 'value': value.value, + 'length_bytes': value['lengthBytes'], + 'value': value['value'], }; } diff --git a/packages/core/src/tonApiV2/models/TonTransferAction.ts b/packages/core/src/tonApiV2/models/TonTransferAction.ts index 95048b78c..708ec642e 100644 --- a/packages/core/src/tonApiV2/models/TonTransferAction.ts +++ b/packages/core/src/tonApiV2/models/TonTransferAction.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { AccountAddress } from './AccountAddress'; import { AccountAddressFromJSON, @@ -80,12 +80,10 @@ export interface TonTransferAction { * Check if a given object implements the TonTransferAction interface. */ export function instanceOfTonTransferAction(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "sender" in value; - isInstance = isInstance && "recipient" in value; - isInstance = isInstance && "amount" in value; - - return isInstance; + if (!('sender' in value)) return false; + if (!('recipient' in value)) return false; + if (!('amount' in value)) return false; + return true; } export function TonTransferActionFromJSON(json: any): TonTransferAction { @@ -93,7 +91,7 @@ export function TonTransferActionFromJSON(json: any): TonTransferAction { } export function TonTransferActionFromJSONTyped(json: any, ignoreDiscriminator: boolean): TonTransferAction { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -101,27 +99,24 @@ export function TonTransferActionFromJSONTyped(json: any, ignoreDiscriminator: b 'sender': AccountAddressFromJSON(json['sender']), 'recipient': AccountAddressFromJSON(json['recipient']), 'amount': json['amount'], - 'comment': !exists(json, 'comment') ? undefined : json['comment'], - 'encryptedComment': !exists(json, 'encrypted_comment') ? undefined : EncryptedCommentFromJSON(json['encrypted_comment']), - 'refund': !exists(json, 'refund') ? undefined : RefundFromJSON(json['refund']), + 'comment': json['comment'] == null ? undefined : json['comment'], + 'encryptedComment': json['encrypted_comment'] == null ? undefined : EncryptedCommentFromJSON(json['encrypted_comment']), + 'refund': json['refund'] == null ? undefined : RefundFromJSON(json['refund']), }; } export function TonTransferActionToJSON(value?: TonTransferAction | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'sender': AccountAddressToJSON(value.sender), - 'recipient': AccountAddressToJSON(value.recipient), - 'amount': value.amount, - 'comment': value.comment, - 'encrypted_comment': EncryptedCommentToJSON(value.encryptedComment), - 'refund': RefundToJSON(value.refund), + 'sender': AccountAddressToJSON(value['sender']), + 'recipient': AccountAddressToJSON(value['recipient']), + 'amount': value['amount'], + 'comment': value['comment'], + 'encrypted_comment': EncryptedCommentToJSON(value['encryptedComment']), + 'refund': RefundToJSON(value['refund']), }; } diff --git a/packages/core/src/tonApiV2/models/Trace.ts b/packages/core/src/tonApiV2/models/Trace.ts index 3ec1c8317..1dfe67543 100644 --- a/packages/core/src/tonApiV2/models/Trace.ts +++ b/packages/core/src/tonApiV2/models/Trace.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { Transaction } from './Transaction'; import { TransactionFromJSON, @@ -56,11 +56,9 @@ export interface Trace { * Check if a given object implements the Trace interface. */ export function instanceOfTrace(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "transaction" in value; - isInstance = isInstance && "interfaces" in value; - - return isInstance; + if (!('transaction' in value)) return false; + if (!('interfaces' in value)) return false; + return true; } export function TraceFromJSON(json: any): Trace { @@ -68,31 +66,28 @@ export function TraceFromJSON(json: any): Trace { } export function TraceFromJSONTyped(json: any, ignoreDiscriminator: boolean): Trace { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'transaction': TransactionFromJSON(json['transaction']), 'interfaces': json['interfaces'], - 'children': !exists(json, 'children') ? undefined : ((json['children'] as Array).map(TraceFromJSON)), - 'emulated': !exists(json, 'emulated') ? undefined : json['emulated'], + 'children': json['children'] == null ? undefined : ((json['children'] as Array).map(TraceFromJSON)), + 'emulated': json['emulated'] == null ? undefined : json['emulated'], }; } export function TraceToJSON(value?: Trace | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'transaction': TransactionToJSON(value.transaction), - 'interfaces': value.interfaces, - 'children': value.children === undefined ? undefined : ((value.children as Array).map(TraceToJSON)), - 'emulated': value.emulated, + 'transaction': TransactionToJSON(value['transaction']), + 'interfaces': value['interfaces'], + 'children': value['children'] == null ? undefined : ((value['children'] as Array).map(TraceToJSON)), + 'emulated': value['emulated'], }; } diff --git a/packages/core/src/tonApiV2/models/TraceID.ts b/packages/core/src/tonApiV2/models/TraceID.ts index b7dbd8cfe..b347df16c 100644 --- a/packages/core/src/tonApiV2/models/TraceID.ts +++ b/packages/core/src/tonApiV2/models/TraceID.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -37,11 +37,9 @@ export interface TraceID { * Check if a given object implements the TraceID interface. */ export function instanceOfTraceID(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "id" in value; - isInstance = isInstance && "utime" in value; - - return isInstance; + if (!('id' in value)) return false; + if (!('utime' in value)) return false; + return true; } export function TraceIDFromJSON(json: any): TraceID { @@ -49,7 +47,7 @@ export function TraceIDFromJSON(json: any): TraceID { } export function TraceIDFromJSONTyped(json: any, ignoreDiscriminator: boolean): TraceID { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -60,16 +58,13 @@ export function TraceIDFromJSONTyped(json: any, ignoreDiscriminator: boolean): T } export function TraceIDToJSON(value?: TraceID | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'id': value.id, - 'utime': value.utime, + 'id': value['id'], + 'utime': value['utime'], }; } diff --git a/packages/core/src/tonApiV2/models/TraceIDs.ts b/packages/core/src/tonApiV2/models/TraceIDs.ts index 9bb85bef5..4b7f307c8 100644 --- a/packages/core/src/tonApiV2/models/TraceIDs.ts +++ b/packages/core/src/tonApiV2/models/TraceIDs.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { TraceID } from './TraceID'; import { TraceIDFromJSON, @@ -38,10 +38,8 @@ export interface TraceIDs { * Check if a given object implements the TraceIDs interface. */ export function instanceOfTraceIDs(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "traces" in value; - - return isInstance; + if (!('traces' in value)) return false; + return true; } export function TraceIDsFromJSON(json: any): TraceIDs { @@ -49,7 +47,7 @@ export function TraceIDsFromJSON(json: any): TraceIDs { } export function TraceIDsFromJSONTyped(json: any, ignoreDiscriminator: boolean): TraceIDs { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -59,15 +57,12 @@ export function TraceIDsFromJSONTyped(json: any, ignoreDiscriminator: boolean): } export function TraceIDsToJSON(value?: TraceIDs | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'traces': ((value.traces as Array).map(TraceIDToJSON)), + 'traces': ((value['traces'] as Array).map(TraceIDToJSON)), }; } diff --git a/packages/core/src/tonApiV2/models/Transaction.ts b/packages/core/src/tonApiV2/models/Transaction.ts index 689dc0220..d7a243ddd 100644 --- a/packages/core/src/tonApiV2/models/Transaction.ts +++ b/packages/core/src/tonApiV2/models/Transaction.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { AccountAddress } from './AccountAddress'; import { AccountAddressFromJSON, @@ -218,24 +218,22 @@ export interface Transaction { * Check if a given object implements the Transaction interface. */ export function instanceOfTransaction(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "hash" in value; - isInstance = isInstance && "lt" in value; - isInstance = isInstance && "account" in value; - isInstance = isInstance && "success" in value; - isInstance = isInstance && "utime" in value; - isInstance = isInstance && "origStatus" in value; - isInstance = isInstance && "endStatus" in value; - isInstance = isInstance && "totalFees" in value; - isInstance = isInstance && "transactionType" in value; - isInstance = isInstance && "stateUpdateOld" in value; - isInstance = isInstance && "stateUpdateNew" in value; - isInstance = isInstance && "outMsgs" in value; - isInstance = isInstance && "block" in value; - isInstance = isInstance && "aborted" in value; - isInstance = isInstance && "destroyed" in value; - - return isInstance; + if (!('hash' in value)) return false; + if (!('lt' in value)) return false; + if (!('account' in value)) return false; + if (!('success' in value)) return false; + if (!('utime' in value)) return false; + if (!('origStatus' in value)) return false; + if (!('endStatus' in value)) return false; + if (!('totalFees' in value)) return false; + if (!('transactionType' in value)) return false; + if (!('stateUpdateOld' in value)) return false; + if (!('stateUpdateNew' in value)) return false; + if (!('outMsgs' in value)) return false; + if (!('block' in value)) return false; + if (!('aborted' in value)) return false; + if (!('destroyed' in value)) return false; + return true; } export function TransactionFromJSON(json: any): Transaction { @@ -243,7 +241,7 @@ export function TransactionFromJSON(json: any): Transaction { } export function TransactionFromJSONTyped(json: any, ignoreDiscriminator: boolean): Transaction { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -259,53 +257,50 @@ export function TransactionFromJSONTyped(json: any, ignoreDiscriminator: boolean 'transactionType': TransactionTypeFromJSON(json['transaction_type']), 'stateUpdateOld': json['state_update_old'], 'stateUpdateNew': json['state_update_new'], - 'inMsg': !exists(json, 'in_msg') ? undefined : MessageFromJSON(json['in_msg']), + 'inMsg': json['in_msg'] == null ? undefined : MessageFromJSON(json['in_msg']), 'outMsgs': ((json['out_msgs'] as Array).map(MessageFromJSON)), 'block': json['block'], - 'prevTransHash': !exists(json, 'prev_trans_hash') ? undefined : json['prev_trans_hash'], - 'prevTransLt': !exists(json, 'prev_trans_lt') ? undefined : json['prev_trans_lt'], - 'computePhase': !exists(json, 'compute_phase') ? undefined : ComputePhaseFromJSON(json['compute_phase']), - 'storagePhase': !exists(json, 'storage_phase') ? undefined : StoragePhaseFromJSON(json['storage_phase']), - 'creditPhase': !exists(json, 'credit_phase') ? undefined : CreditPhaseFromJSON(json['credit_phase']), - 'actionPhase': !exists(json, 'action_phase') ? undefined : ActionPhaseFromJSON(json['action_phase']), - 'bouncePhase': !exists(json, 'bounce_phase') ? undefined : BouncePhaseTypeFromJSON(json['bounce_phase']), + 'prevTransHash': json['prev_trans_hash'] == null ? undefined : json['prev_trans_hash'], + 'prevTransLt': json['prev_trans_lt'] == null ? undefined : json['prev_trans_lt'], + 'computePhase': json['compute_phase'] == null ? undefined : ComputePhaseFromJSON(json['compute_phase']), + 'storagePhase': json['storage_phase'] == null ? undefined : StoragePhaseFromJSON(json['storage_phase']), + 'creditPhase': json['credit_phase'] == null ? undefined : CreditPhaseFromJSON(json['credit_phase']), + 'actionPhase': json['action_phase'] == null ? undefined : ActionPhaseFromJSON(json['action_phase']), + 'bouncePhase': json['bounce_phase'] == null ? undefined : BouncePhaseTypeFromJSON(json['bounce_phase']), 'aborted': json['aborted'], 'destroyed': json['destroyed'], }; } export function TransactionToJSON(value?: Transaction | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'hash': value.hash, - 'lt': value.lt, - 'account': AccountAddressToJSON(value.account), - 'success': value.success, - 'utime': value.utime, - 'orig_status': AccountStatusToJSON(value.origStatus), - 'end_status': AccountStatusToJSON(value.endStatus), - 'total_fees': value.totalFees, - 'transaction_type': TransactionTypeToJSON(value.transactionType), - 'state_update_old': value.stateUpdateOld, - 'state_update_new': value.stateUpdateNew, - 'in_msg': MessageToJSON(value.inMsg), - 'out_msgs': ((value.outMsgs as Array).map(MessageToJSON)), - 'block': value.block, - 'prev_trans_hash': value.prevTransHash, - 'prev_trans_lt': value.prevTransLt, - 'compute_phase': ComputePhaseToJSON(value.computePhase), - 'storage_phase': StoragePhaseToJSON(value.storagePhase), - 'credit_phase': CreditPhaseToJSON(value.creditPhase), - 'action_phase': ActionPhaseToJSON(value.actionPhase), - 'bounce_phase': BouncePhaseTypeToJSON(value.bouncePhase), - 'aborted': value.aborted, - 'destroyed': value.destroyed, + 'hash': value['hash'], + 'lt': value['lt'], + 'account': AccountAddressToJSON(value['account']), + 'success': value['success'], + 'utime': value['utime'], + 'orig_status': AccountStatusToJSON(value['origStatus']), + 'end_status': AccountStatusToJSON(value['endStatus']), + 'total_fees': value['totalFees'], + 'transaction_type': TransactionTypeToJSON(value['transactionType']), + 'state_update_old': value['stateUpdateOld'], + 'state_update_new': value['stateUpdateNew'], + 'in_msg': MessageToJSON(value['inMsg']), + 'out_msgs': ((value['outMsgs'] as Array).map(MessageToJSON)), + 'block': value['block'], + 'prev_trans_hash': value['prevTransHash'], + 'prev_trans_lt': value['prevTransLt'], + 'compute_phase': ComputePhaseToJSON(value['computePhase']), + 'storage_phase': StoragePhaseToJSON(value['storagePhase']), + 'credit_phase': CreditPhaseToJSON(value['creditPhase']), + 'action_phase': ActionPhaseToJSON(value['actionPhase']), + 'bounce_phase': BouncePhaseTypeToJSON(value['bouncePhase']), + 'aborted': value['aborted'], + 'destroyed': value['destroyed'], }; } diff --git a/packages/core/src/tonApiV2/models/Transactions.ts b/packages/core/src/tonApiV2/models/Transactions.ts index c012feae6..f53d60235 100644 --- a/packages/core/src/tonApiV2/models/Transactions.ts +++ b/packages/core/src/tonApiV2/models/Transactions.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { Transaction } from './Transaction'; import { TransactionFromJSON, @@ -38,10 +38,8 @@ export interface Transactions { * Check if a given object implements the Transactions interface. */ export function instanceOfTransactions(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "transactions" in value; - - return isInstance; + if (!('transactions' in value)) return false; + return true; } export function TransactionsFromJSON(json: any): Transactions { @@ -49,7 +47,7 @@ export function TransactionsFromJSON(json: any): Transactions { } export function TransactionsFromJSONTyped(json: any, ignoreDiscriminator: boolean): Transactions { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -59,15 +57,12 @@ export function TransactionsFromJSONTyped(json: any, ignoreDiscriminator: boolea } export function TransactionsToJSON(value?: Transactions | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'transactions': ((value.transactions as Array).map(TransactionToJSON)), + 'transactions': ((value['transactions'] as Array).map(TransactionToJSON)), }; } diff --git a/packages/core/src/tonApiV2/models/TvmStackRecord.ts b/packages/core/src/tonApiV2/models/TvmStackRecord.ts index 48d29de57..88e5c687f 100644 --- a/packages/core/src/tonApiV2/models/TvmStackRecord.ts +++ b/packages/core/src/tonApiV2/models/TvmStackRecord.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -69,10 +69,8 @@ export type TvmStackRecordTypeEnum = typeof TvmStackRecordTypeEnum[keyof typeof * Check if a given object implements the TvmStackRecord interface. */ export function instanceOfTvmStackRecord(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "type" in value; - - return isInstance; + if (!('type' in value)) return false; + return true; } export function TvmStackRecordFromJSON(json: any): TvmStackRecord { @@ -80,33 +78,30 @@ export function TvmStackRecordFromJSON(json: any): TvmStackRecord { } export function TvmStackRecordFromJSONTyped(json: any, ignoreDiscriminator: boolean): TvmStackRecord { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'type': json['type'], - 'cell': !exists(json, 'cell') ? undefined : json['cell'], - 'slice': !exists(json, 'slice') ? undefined : json['slice'], - 'num': !exists(json, 'num') ? undefined : json['num'], - 'tuple': !exists(json, 'tuple') ? undefined : ((json['tuple'] as Array).map(TvmStackRecordFromJSON)), + 'cell': json['cell'] == null ? undefined : json['cell'], + 'slice': json['slice'] == null ? undefined : json['slice'], + 'num': json['num'] == null ? undefined : json['num'], + 'tuple': json['tuple'] == null ? undefined : ((json['tuple'] as Array).map(TvmStackRecordFromJSON)), }; } export function TvmStackRecordToJSON(value?: TvmStackRecord | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'type': value.type, - 'cell': value.cell, - 'slice': value.slice, - 'num': value.num, - 'tuple': value.tuple === undefined ? undefined : ((value.tuple as Array).map(TvmStackRecordToJSON)), + 'type': value['type'], + 'cell': value['cell'], + 'slice': value['slice'], + 'num': value['num'], + 'tuple': value['tuple'] == null ? undefined : ((value['tuple'] as Array).map(TvmStackRecordToJSON)), }; } diff --git a/packages/core/src/tonApiV2/models/UnSubscriptionAction.ts b/packages/core/src/tonApiV2/models/UnSubscriptionAction.ts index 42f224185..f2799cc20 100644 --- a/packages/core/src/tonApiV2/models/UnSubscriptionAction.ts +++ b/packages/core/src/tonApiV2/models/UnSubscriptionAction.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { AccountAddress } from './AccountAddress'; import { AccountAddressFromJSON, @@ -50,12 +50,10 @@ export interface UnSubscriptionAction { * Check if a given object implements the UnSubscriptionAction interface. */ export function instanceOfUnSubscriptionAction(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "subscriber" in value; - isInstance = isInstance && "subscription" in value; - isInstance = isInstance && "beneficiary" in value; - - return isInstance; + if (!('subscriber' in value)) return false; + if (!('subscription' in value)) return false; + if (!('beneficiary' in value)) return false; + return true; } export function UnSubscriptionActionFromJSON(json: any): UnSubscriptionAction { @@ -63,7 +61,7 @@ export function UnSubscriptionActionFromJSON(json: any): UnSubscriptionAction { } export function UnSubscriptionActionFromJSONTyped(json: any, ignoreDiscriminator: boolean): UnSubscriptionAction { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -75,17 +73,14 @@ export function UnSubscriptionActionFromJSONTyped(json: any, ignoreDiscriminator } export function UnSubscriptionActionToJSON(value?: UnSubscriptionAction | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'subscriber': AccountAddressToJSON(value.subscriber), - 'subscription': value.subscription, - 'beneficiary': AccountAddressToJSON(value.beneficiary), + 'subscriber': AccountAddressToJSON(value['subscriber']), + 'subscription': value['subscription'], + 'beneficiary': AccountAddressToJSON(value['beneficiary']), }; } diff --git a/packages/core/src/tonApiV2/models/Validator.ts b/packages/core/src/tonApiV2/models/Validator.ts index 9f093d312..93bce58ad 100644 --- a/packages/core/src/tonApiV2/models/Validator.ts +++ b/packages/core/src/tonApiV2/models/Validator.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -49,13 +49,11 @@ export interface Validator { * Check if a given object implements the Validator interface. */ export function instanceOfValidator(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "address" in value; - isInstance = isInstance && "adnlAddress" in value; - isInstance = isInstance && "stake" in value; - isInstance = isInstance && "maxFactor" in value; - - return isInstance; + if (!('address' in value)) return false; + if (!('adnlAddress' in value)) return false; + if (!('stake' in value)) return false; + if (!('maxFactor' in value)) return false; + return true; } export function ValidatorFromJSON(json: any): Validator { @@ -63,7 +61,7 @@ export function ValidatorFromJSON(json: any): Validator { } export function ValidatorFromJSONTyped(json: any, ignoreDiscriminator: boolean): Validator { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -76,18 +74,15 @@ export function ValidatorFromJSONTyped(json: any, ignoreDiscriminator: boolean): } export function ValidatorToJSON(value?: Validator | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'address': value.address, - 'adnl_address': value.adnlAddress, - 'stake': value.stake, - 'max_factor': value.maxFactor, + 'address': value['address'], + 'adnl_address': value['adnlAddress'], + 'stake': value['stake'], + 'max_factor': value['maxFactor'], }; } diff --git a/packages/core/src/tonApiV2/models/Validators.ts b/packages/core/src/tonApiV2/models/Validators.ts index 33e0e01a3..fbdde2fb5 100644 --- a/packages/core/src/tonApiV2/models/Validators.ts +++ b/packages/core/src/tonApiV2/models/Validators.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { Validator } from './Validator'; import { ValidatorFromJSON, @@ -62,14 +62,12 @@ export interface Validators { * Check if a given object implements the Validators interface. */ export function instanceOfValidators(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "electAt" in value; - isInstance = isInstance && "electClose" in value; - isInstance = isInstance && "minStake" in value; - isInstance = isInstance && "totalStake" in value; - isInstance = isInstance && "validators" in value; - - return isInstance; + if (!('electAt' in value)) return false; + if (!('electClose' in value)) return false; + if (!('minStake' in value)) return false; + if (!('totalStake' in value)) return false; + if (!('validators' in value)) return false; + return true; } export function ValidatorsFromJSON(json: any): Validators { @@ -77,7 +75,7 @@ export function ValidatorsFromJSON(json: any): Validators { } export function ValidatorsFromJSONTyped(json: any, ignoreDiscriminator: boolean): Validators { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -91,19 +89,16 @@ export function ValidatorsFromJSONTyped(json: any, ignoreDiscriminator: boolean) } export function ValidatorsToJSON(value?: Validators | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'elect_at': value.electAt, - 'elect_close': value.electClose, - 'min_stake': value.minStake, - 'total_stake': value.totalStake, - 'validators': ((value.validators as Array).map(ValidatorToJSON)), + 'elect_at': value['electAt'], + 'elect_close': value['electClose'], + 'min_stake': value['minStake'], + 'total_stake': value['totalStake'], + 'validators': ((value['validators'] as Array).map(ValidatorToJSON)), }; } diff --git a/packages/core/src/tonApiV2/models/ValidatorsSet.ts b/packages/core/src/tonApiV2/models/ValidatorsSet.ts index e963c6ae7..2000aaf6e 100644 --- a/packages/core/src/tonApiV2/models/ValidatorsSet.ts +++ b/packages/core/src/tonApiV2/models/ValidatorsSet.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { ValidatorsSetListInner } from './ValidatorsSetListInner'; import { ValidatorsSetListInnerFromJSON, @@ -68,14 +68,12 @@ export interface ValidatorsSet { * Check if a given object implements the ValidatorsSet interface. */ export function instanceOfValidatorsSet(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "utimeSince" in value; - isInstance = isInstance && "utimeUntil" in value; - isInstance = isInstance && "total" in value; - isInstance = isInstance && "main" in value; - isInstance = isInstance && "list" in value; - - return isInstance; + if (!('utimeSince' in value)) return false; + if (!('utimeUntil' in value)) return false; + if (!('total' in value)) return false; + if (!('main' in value)) return false; + if (!('list' in value)) return false; + return true; } export function ValidatorsSetFromJSON(json: any): ValidatorsSet { @@ -83,7 +81,7 @@ export function ValidatorsSetFromJSON(json: any): ValidatorsSet { } export function ValidatorsSetFromJSONTyped(json: any, ignoreDiscriminator: boolean): ValidatorsSet { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -92,26 +90,23 @@ export function ValidatorsSetFromJSONTyped(json: any, ignoreDiscriminator: boole 'utimeUntil': json['utime_until'], 'total': json['total'], 'main': json['main'], - 'totalWeight': !exists(json, 'total_weight') ? undefined : json['total_weight'], + 'totalWeight': json['total_weight'] == null ? undefined : json['total_weight'], 'list': ((json['list'] as Array).map(ValidatorsSetListInnerFromJSON)), }; } export function ValidatorsSetToJSON(value?: ValidatorsSet | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'utime_since': value.utimeSince, - 'utime_until': value.utimeUntil, - 'total': value.total, - 'main': value.main, - 'total_weight': value.totalWeight, - 'list': ((value.list as Array).map(ValidatorsSetListInnerToJSON)), + 'utime_since': value['utimeSince'], + 'utime_until': value['utimeUntil'], + 'total': value['total'], + 'main': value['main'], + 'total_weight': value['totalWeight'], + 'list': ((value['list'] as Array).map(ValidatorsSetListInnerToJSON)), }; } diff --git a/packages/core/src/tonApiV2/models/ValidatorsSetListInner.ts b/packages/core/src/tonApiV2/models/ValidatorsSetListInner.ts index e55f18fcc..22353e2c2 100644 --- a/packages/core/src/tonApiV2/models/ValidatorsSetListInner.ts +++ b/packages/core/src/tonApiV2/models/ValidatorsSetListInner.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -43,11 +43,9 @@ export interface ValidatorsSetListInner { * Check if a given object implements the ValidatorsSetListInner interface. */ export function instanceOfValidatorsSetListInner(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "publicKey" in value; - isInstance = isInstance && "weight" in value; - - return isInstance; + if (!('publicKey' in value)) return false; + if (!('weight' in value)) return false; + return true; } export function ValidatorsSetListInnerFromJSON(json: any): ValidatorsSetListInner { @@ -55,29 +53,26 @@ export function ValidatorsSetListInnerFromJSON(json: any): ValidatorsSetListInne } export function ValidatorsSetListInnerFromJSONTyped(json: any, ignoreDiscriminator: boolean): ValidatorsSetListInner { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { 'publicKey': json['public_key'], 'weight': json['weight'], - 'adnlAddr': !exists(json, 'adnl_addr') ? undefined : json['adnl_addr'], + 'adnlAddr': json['adnl_addr'] == null ? undefined : json['adnl_addr'], }; } export function ValidatorsSetListInnerToJSON(value?: ValidatorsSetListInner | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'public_key': value.publicKey, - 'weight': value.weight, - 'adnl_addr': value.adnlAddr, + 'public_key': value['publicKey'], + 'weight': value['weight'], + 'adnl_addr': value['adnlAddr'], }; } diff --git a/packages/core/src/tonApiV2/models/ValueFlow.ts b/packages/core/src/tonApiV2/models/ValueFlow.ts index dcd70060a..99c6ee359 100644 --- a/packages/core/src/tonApiV2/models/ValueFlow.ts +++ b/packages/core/src/tonApiV2/models/ValueFlow.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { AccountAddress } from './AccountAddress'; import { AccountAddressFromJSON, @@ -62,12 +62,10 @@ export interface ValueFlow { * Check if a given object implements the ValueFlow interface. */ export function instanceOfValueFlow(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "account" in value; - isInstance = isInstance && "ton" in value; - isInstance = isInstance && "fees" in value; - - return isInstance; + if (!('account' in value)) return false; + if (!('ton' in value)) return false; + if (!('fees' in value)) return false; + return true; } export function ValueFlowFromJSON(json: any): ValueFlow { @@ -75,7 +73,7 @@ export function ValueFlowFromJSON(json: any): ValueFlow { } export function ValueFlowFromJSONTyped(json: any, ignoreDiscriminator: boolean): ValueFlow { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -83,23 +81,20 @@ export function ValueFlowFromJSONTyped(json: any, ignoreDiscriminator: boolean): 'account': AccountAddressFromJSON(json['account']), 'ton': json['ton'], 'fees': json['fees'], - 'jettons': !exists(json, 'jettons') ? undefined : ((json['jettons'] as Array).map(ValueFlowJettonsInnerFromJSON)), + 'jettons': json['jettons'] == null ? undefined : ((json['jettons'] as Array).map(ValueFlowJettonsInnerFromJSON)), }; } export function ValueFlowToJSON(value?: ValueFlow | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'account': AccountAddressToJSON(value.account), - 'ton': value.ton, - 'fees': value.fees, - 'jettons': value.jettons === undefined ? undefined : ((value.jettons as Array).map(ValueFlowJettonsInnerToJSON)), + 'account': AccountAddressToJSON(value['account']), + 'ton': value['ton'], + 'fees': value['fees'], + 'jettons': value['jettons'] == null ? undefined : ((value['jettons'] as Array).map(ValueFlowJettonsInnerToJSON)), }; } diff --git a/packages/core/src/tonApiV2/models/ValueFlowJettonsInner.ts b/packages/core/src/tonApiV2/models/ValueFlowJettonsInner.ts index 1b43b374c..a87981051 100644 --- a/packages/core/src/tonApiV2/models/ValueFlowJettonsInner.ts +++ b/packages/core/src/tonApiV2/models/ValueFlowJettonsInner.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { AccountAddress } from './AccountAddress'; import { AccountAddressFromJSON, @@ -56,12 +56,10 @@ export interface ValueFlowJettonsInner { * Check if a given object implements the ValueFlowJettonsInner interface. */ export function instanceOfValueFlowJettonsInner(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "account" in value; - isInstance = isInstance && "jetton" in value; - isInstance = isInstance && "quantity" in value; - - return isInstance; + if (!('account' in value)) return false; + if (!('jetton' in value)) return false; + if (!('quantity' in value)) return false; + return true; } export function ValueFlowJettonsInnerFromJSON(json: any): ValueFlowJettonsInner { @@ -69,7 +67,7 @@ export function ValueFlowJettonsInnerFromJSON(json: any): ValueFlowJettonsInner } export function ValueFlowJettonsInnerFromJSONTyped(json: any, ignoreDiscriminator: boolean): ValueFlowJettonsInner { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -81,17 +79,14 @@ export function ValueFlowJettonsInnerFromJSONTyped(json: any, ignoreDiscriminato } export function ValueFlowJettonsInnerToJSON(value?: ValueFlowJettonsInner | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'account': AccountAddressToJSON(value.account), - 'jetton': JettonPreviewToJSON(value.jetton), - 'quantity': value.quantity, + 'account': AccountAddressToJSON(value['account']), + 'jetton': JettonPreviewToJSON(value['jetton']), + 'quantity': value['quantity'], }; } diff --git a/packages/core/src/tonApiV2/models/WalletDNS.ts b/packages/core/src/tonApiV2/models/WalletDNS.ts index 539d6f9c6..4383ea063 100644 --- a/packages/core/src/tonApiV2/models/WalletDNS.ts +++ b/packages/core/src/tonApiV2/models/WalletDNS.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -55,14 +55,12 @@ export interface WalletDNS { * Check if a given object implements the WalletDNS interface. */ export function instanceOfWalletDNS(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "address" in value; - isInstance = isInstance && "isWallet" in value; - isInstance = isInstance && "hasMethodPubkey" in value; - isInstance = isInstance && "hasMethodSeqno" in value; - isInstance = isInstance && "names" in value; - - return isInstance; + if (!('address' in value)) return false; + if (!('isWallet' in value)) return false; + if (!('hasMethodPubkey' in value)) return false; + if (!('hasMethodSeqno' in value)) return false; + if (!('names' in value)) return false; + return true; } export function WalletDNSFromJSON(json: any): WalletDNS { @@ -70,7 +68,7 @@ export function WalletDNSFromJSON(json: any): WalletDNS { } export function WalletDNSFromJSONTyped(json: any, ignoreDiscriminator: boolean): WalletDNS { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -84,19 +82,16 @@ export function WalletDNSFromJSONTyped(json: any, ignoreDiscriminator: boolean): } export function WalletDNSToJSON(value?: WalletDNS | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'address': value.address, - 'is_wallet': value.isWallet, - 'has_method_pubkey': value.hasMethodPubkey, - 'has_method_seqno': value.hasMethodSeqno, - 'names': value.names, + 'address': value['address'], + 'is_wallet': value['isWallet'], + 'has_method_pubkey': value['hasMethodPubkey'], + 'has_method_seqno': value['hasMethodSeqno'], + 'names': value['names'], }; } diff --git a/packages/core/src/tonApiV2/models/WithdrawStakeAction.ts b/packages/core/src/tonApiV2/models/WithdrawStakeAction.ts index f726ade5c..1a81ccd98 100644 --- a/packages/core/src/tonApiV2/models/WithdrawStakeAction.ts +++ b/packages/core/src/tonApiV2/models/WithdrawStakeAction.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { AccountAddress } from './AccountAddress'; import { AccountAddressFromJSON, @@ -62,13 +62,11 @@ export interface WithdrawStakeAction { * Check if a given object implements the WithdrawStakeAction interface. */ export function instanceOfWithdrawStakeAction(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "amount" in value; - isInstance = isInstance && "staker" in value; - isInstance = isInstance && "pool" in value; - isInstance = isInstance && "implementation" in value; - - return isInstance; + if (!('amount' in value)) return false; + if (!('staker' in value)) return false; + if (!('pool' in value)) return false; + if (!('implementation' in value)) return false; + return true; } export function WithdrawStakeActionFromJSON(json: any): WithdrawStakeAction { @@ -76,7 +74,7 @@ export function WithdrawStakeActionFromJSON(json: any): WithdrawStakeAction { } export function WithdrawStakeActionFromJSONTyped(json: any, ignoreDiscriminator: boolean): WithdrawStakeAction { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -89,18 +87,15 @@ export function WithdrawStakeActionFromJSONTyped(json: any, ignoreDiscriminator: } export function WithdrawStakeActionToJSON(value?: WithdrawStakeAction | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'amount': value.amount, - 'staker': AccountAddressToJSON(value.staker), - 'pool': AccountAddressToJSON(value.pool), - 'implementation': PoolImplementationTypeToJSON(value.implementation), + 'amount': value['amount'], + 'staker': AccountAddressToJSON(value['staker']), + 'pool': AccountAddressToJSON(value['pool']), + 'implementation': PoolImplementationTypeToJSON(value['implementation']), }; } diff --git a/packages/core/src/tonApiV2/models/WithdrawStakeRequestAction.ts b/packages/core/src/tonApiV2/models/WithdrawStakeRequestAction.ts index acdd507a3..eadd0cd6d 100644 --- a/packages/core/src/tonApiV2/models/WithdrawStakeRequestAction.ts +++ b/packages/core/src/tonApiV2/models/WithdrawStakeRequestAction.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; import type { AccountAddress } from './AccountAddress'; import { AccountAddressFromJSON, @@ -62,12 +62,10 @@ export interface WithdrawStakeRequestAction { * Check if a given object implements the WithdrawStakeRequestAction interface. */ export function instanceOfWithdrawStakeRequestAction(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "staker" in value; - isInstance = isInstance && "pool" in value; - isInstance = isInstance && "implementation" in value; - - return isInstance; + if (!('staker' in value)) return false; + if (!('pool' in value)) return false; + if (!('implementation' in value)) return false; + return true; } export function WithdrawStakeRequestActionFromJSON(json: any): WithdrawStakeRequestAction { @@ -75,12 +73,12 @@ export function WithdrawStakeRequestActionFromJSON(json: any): WithdrawStakeRequ } export function WithdrawStakeRequestActionFromJSONTyped(json: any, ignoreDiscriminator: boolean): WithdrawStakeRequestAction { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { - 'amount': !exists(json, 'amount') ? undefined : json['amount'], + 'amount': json['amount'] == null ? undefined : json['amount'], 'staker': AccountAddressFromJSON(json['staker']), 'pool': AccountAddressFromJSON(json['pool']), 'implementation': PoolImplementationTypeFromJSON(json['implementation']), @@ -88,18 +86,15 @@ export function WithdrawStakeRequestActionFromJSONTyped(json: any, ignoreDiscrim } export function WithdrawStakeRequestActionToJSON(value?: WithdrawStakeRequestAction | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'amount': value.amount, - 'staker': AccountAddressToJSON(value.staker), - 'pool': AccountAddressToJSON(value.pool), - 'implementation': PoolImplementationTypeToJSON(value.implementation), + 'amount': value['amount'], + 'staker': AccountAddressToJSON(value['staker']), + 'pool': AccountAddressToJSON(value['pool']), + 'implementation': PoolImplementationTypeToJSON(value['implementation']), }; } diff --git a/packages/core/src/tonApiV2/models/WorkchainDescr.ts b/packages/core/src/tonApiV2/models/WorkchainDescr.ts index 6fc6b4111..0761117a9 100644 --- a/packages/core/src/tonApiV2/models/WorkchainDescr.ts +++ b/packages/core/src/tonApiV2/models/WorkchainDescr.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -import { exists, mapValues } from '../runtime'; +import { mapValues } from '../runtime'; /** * * @export @@ -97,21 +97,19 @@ export interface WorkchainDescr { * Check if a given object implements the WorkchainDescr interface. */ export function instanceOfWorkchainDescr(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "workchain" in value; - isInstance = isInstance && "enabledSince" in value; - isInstance = isInstance && "actualMinSplit" in value; - isInstance = isInstance && "minSplit" in value; - isInstance = isInstance && "maxSplit" in value; - isInstance = isInstance && "basic" in value; - isInstance = isInstance && "active" in value; - isInstance = isInstance && "acceptMsgs" in value; - isInstance = isInstance && "flags" in value; - isInstance = isInstance && "zerostateRootHash" in value; - isInstance = isInstance && "zerostateFileHash" in value; - isInstance = isInstance && "version" in value; - - return isInstance; + if (!('workchain' in value)) return false; + if (!('enabledSince' in value)) return false; + if (!('actualMinSplit' in value)) return false; + if (!('minSplit' in value)) return false; + if (!('maxSplit' in value)) return false; + if (!('basic' in value)) return false; + if (!('active' in value)) return false; + if (!('acceptMsgs' in value)) return false; + if (!('flags' in value)) return false; + if (!('zerostateRootHash' in value)) return false; + if (!('zerostateFileHash' in value)) return false; + if (!('version' in value)) return false; + return true; } export function WorkchainDescrFromJSON(json: any): WorkchainDescr { @@ -119,7 +117,7 @@ export function WorkchainDescrFromJSON(json: any): WorkchainDescr { } export function WorkchainDescrFromJSONTyped(json: any, ignoreDiscriminator: boolean): WorkchainDescr { - if ((json === undefined) || (json === null)) { + if (json == null) { return json; } return { @@ -140,26 +138,23 @@ export function WorkchainDescrFromJSONTyped(json: any, ignoreDiscriminator: bool } export function WorkchainDescrToJSON(value?: WorkchainDescr | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; + if (value == null) { + return value; } return { - 'workchain': value.workchain, - 'enabled_since': value.enabledSince, - 'actual_min_split': value.actualMinSplit, - 'min_split': value.minSplit, - 'max_split': value.maxSplit, - 'basic': value.basic, - 'active': value.active, - 'accept_msgs': value.acceptMsgs, - 'flags': value.flags, - 'zerostate_root_hash': value.zerostateRootHash, - 'zerostate_file_hash': value.zerostateFileHash, - 'version': value.version, + 'workchain': value['workchain'], + 'enabled_since': value['enabledSince'], + 'actual_min_split': value['actualMinSplit'], + 'min_split': value['minSplit'], + 'max_split': value['maxSplit'], + 'basic': value['basic'], + 'active': value['active'], + 'accept_msgs': value['acceptMsgs'], + 'flags': value['flags'], + 'zerostate_root_hash': value['zerostateRootHash'], + 'zerostate_file_hash': value['zerostateFileHash'], + 'version': value['version'], }; } diff --git a/packages/core/src/tonApiV2/models/index.ts b/packages/core/src/tonApiV2/models/index.ts index f727759ca..3a0b332ee 100644 --- a/packages/core/src/tonApiV2/models/index.ts +++ b/packages/core/src/tonApiV2/models/index.ts @@ -64,6 +64,7 @@ export * from './BlockchainConfig7CurrenciesInner'; export * from './BlockchainConfig8'; export * from './BlockchainConfig9'; export * from './BlockchainRawAccount'; +export * from './BlockchainRawAccountLibrariesInner'; export * from './BouncePhaseType'; export * from './ComputePhase'; export * from './ComputeSkipReason'; @@ -101,7 +102,6 @@ export * from './GetAccountInfoByStateInitRequest'; export * from './GetAccountPublicKey200Response'; export * from './GetAccountsRequest'; export * from './GetAllRawShardsInfo200Response'; -export * from './GetBlockchainBlockDefaultResponse'; export * from './GetChartRates200Response'; export * from './GetInscriptionOpTemplate200Response'; export * from './GetRates200Response'; @@ -173,6 +173,7 @@ export * from './PoolImplementationType'; export * from './PoolInfo'; export * from './Price'; export * from './RawBlockchainConfig'; +export * from './ReduceIndexingLatencyDefaultResponse'; export * from './Refund'; export * from './Risk'; export * from './Sale'; @@ -180,6 +181,7 @@ export * from './SendBlockchainMessageRequest'; export * from './SendRawMessage200Response'; export * from './SendRawMessageRequest'; export * from './Seqno'; +export * from './ServiceStatus'; export * from './SizeLimitsConfig'; export * from './SmartContractAction'; export * from './StateInit'; diff --git a/packages/core/src/tonApiV2/runtime.ts b/packages/core/src/tonApiV2/runtime.ts index 978c4737a..1b1c7ad94 100644 --- a/packages/core/src/tonApiV2/runtime.ts +++ b/packages/core/src/tonApiV2/runtime.ts @@ -22,7 +22,7 @@ export interface ConfigurationParameters { queryParamsStringify?: (params: HTTPQuery) => string; // stringify function for query strings username?: string; // parameter for basic security password?: string; // parameter for basic security - apiKey?: string | ((name: string) => string); // parameter for apiKey security + apiKey?: string | Promise | ((name: string) => string | Promise); // parameter for apiKey security accessToken?: string | Promise | ((name?: string, scopes?: string[]) => string | Promise); // parameter for oauth2 security headers?: HTTPHeaders; //header params we want to use on every request credentials?: RequestCredentials; //value for the credentials param we want to use on each request @@ -59,7 +59,7 @@ export class Configuration { return this.configuration.password; } - get apiKey(): ((name: string) => string) | undefined { + get apiKey(): ((name: string) => string | Promise) | undefined { const apiKey = this.configuration.apiKey; if (apiKey) { return typeof apiKey === 'function' ? apiKey : () => apiKey; @@ -310,11 +310,6 @@ export interface RequestOpts { body?: HTTPBody; } -export function exists(json: any, key: string) { - const value = json[key]; - return value !== null && value !== undefined; -} - export function querystring(params: HTTPQuery, prefix: string = ''): string { return Object.keys(params) .map(key => querystringSingleKey(key, params[key], prefix)) diff --git a/packages/uikit/src/hooks/blockchain/useEstimateTonFee.ts b/packages/uikit/src/hooks/blockchain/useEstimateTonFee.ts index a919d5957..f5072fe5d 100644 --- a/packages/uikit/src/hooks/blockchain/useEstimateTonFee.ts +++ b/packages/uikit/src/hooks/blockchain/useEstimateTonFee.ts @@ -35,6 +35,7 @@ export function useEstimateTonFee( const boc = await caller({ ...args, walletState, api } as Args); const event = await new EmulationApi(api.tonApiV2).emulateMessageToAccountEvent({ + ignoreSignatureCheck: true, accountId: walletState.active.rawAddress, decodeMessageRequest: { boc } }); diff --git a/packages/uikit/src/state/rates.ts b/packages/uikit/src/state/rates.ts index cff6da1e3..0e5d604d5 100644 --- a/packages/uikit/src/state/rates.ts +++ b/packages/uikit/src/state/rates.ts @@ -33,8 +33,8 @@ export const usePreFetchRates = () => { [QueryKey.rate], async () => { const value = await new RatesApi(tonApiV2).getRates({ - tokens: [CryptoCurrency.TON, CryptoCurrency.USDT].join(','), - currencies: fiat + tokens: [CryptoCurrency.TON, CryptoCurrency.USDT], + currencies: [fiat] }); if (!value || !value.rates) { @@ -70,8 +70,8 @@ export const useRate = (token: string) => { getRateKey(fiat, token), async () => { const value = await new RatesApi(tonApiV2).getRates({ - tokens: token, - currencies: fiat + tokens: [token], + currencies: [fiat] }); try { diff --git a/packages/uikit/src/state/wallet.ts b/packages/uikit/src/state/wallet.ts index 5c3f1ebf6..429359769 100644 --- a/packages/uikit/src/state/wallet.ts +++ b/packages/uikit/src/state/wallet.ts @@ -156,7 +156,7 @@ export const useWalletJettonList = () => { async () => { const result = await new AccountsApi(api.tonApiV2).getAccountJettonsBalances({ accountId: wallet.active.rawAddress, - currencies: fiat + currencies: [fiat] }); result.balances.forEach(item => { From 62434ef92056b715a7616582cf41feac49415367 Mon Sep 17 00:00:00 2001 From: Nikita Kuznetsov Date: Fri, 22 Mar 2024 14:33:01 +0100 Subject: [PATCH 07/10] User W5 without lib --- packages/core/package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/core/package.json b/packages/core/package.json index 16e85862f..fc20578a3 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -21,7 +21,7 @@ "dependencies": { "@ton/core": "0.54.0", "@ton/crypto": "3.2.0", - "@ton/ton": "https://github.com/tonkeeper/tonkeeper-ton#build5", + "@ton/ton": "https://github.com/tonkeeper/tonkeeper-ton#build6", "bignumber.js": "^9.1.1", "ethers": "^6.6.5", "query-string": "^8.1.0", diff --git a/yarn.lock b/yarn.lock index b120dfda7..c8c6dbbed 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6064,9 +6064,9 @@ __metadata: languageName: node linkType: hard -"@ton/ton@https://github.com/tonkeeper/tonkeeper-ton#build5": +"@ton/ton@https://github.com/tonkeeper/tonkeeper-ton#build6": version: 13.9.0 - resolution: "@ton/ton@https://github.com/tonkeeper/tonkeeper-ton.git#commit=97451d09801c5e5680958d146c8025c3793c5f26" + resolution: "@ton/ton@https://github.com/tonkeeper/tonkeeper-ton.git#commit=1ee04f1d8bb2daf338717d0e076a4a22fa0babb4" dependencies: axios: "npm:^0.25.0" dataloader: "npm:^2.0.0" @@ -6076,7 +6076,7 @@ __metadata: peerDependencies: "@ton/core": ">=0.53.0" "@ton/crypto": ">=3.2.0" - checksum: 39ca8e1f2e756ce41af112c70a6252b4b4b84435e6dc5f4112e67c37cfcce9d0e1d2244657b4fabe5b8a8b2dbca4d37201c5f771a531682b0225a8241c27b564 + checksum: 31193e67ad75bc5ab0a6938e7c5fec093ac0f4ad732f16e9d1cbf54154b7f7345cca7df292e185095dd5df411705eb0a7d46367b089a67419f9418e36d832876 languageName: node linkType: hard @@ -6086,7 +6086,7 @@ __metadata: dependencies: "@ton/core": "npm:0.54.0" "@ton/crypto": "npm:3.2.0" - "@ton/ton": "https://github.com/tonkeeper/tonkeeper-ton#build5" + "@ton/ton": "https://github.com/tonkeeper/tonkeeper-ton#build6" bignumber.js: "npm:^9.1.1" ethers: "npm:^6.6.5" npm-run-all: "npm:^4.1.5" From 0e3d657beacc6fcc1687e90bce7d7890de4e5311 Mon Sep 17 00:00:00 2001 From: Nikita Kuznetsov Date: Fri, 22 Mar 2024 15:30:34 +0100 Subject: [PATCH 08/10] Update ton lib --- packages/core/package.json | 2 +- packages/core/src/service/transfer/tonService.ts | 2 +- yarn.lock | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/core/package.json b/packages/core/package.json index fc20578a3..d37903a18 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -21,7 +21,7 @@ "dependencies": { "@ton/core": "0.54.0", "@ton/crypto": "3.2.0", - "@ton/ton": "https://github.com/tonkeeper/tonkeeper-ton#build6", + "@ton/ton": "https://github.com/tonkeeper/tonkeeper-ton#build8", "bignumber.js": "^9.1.1", "ethers": "^6.6.5", "query-string": "^8.1.0", diff --git a/packages/core/src/service/transfer/tonService.ts b/packages/core/src/service/transfer/tonService.ts index 0b041fd12..dc4190b0b 100644 --- a/packages/core/src/service/transfer/tonService.ts +++ b/packages/core/src/service/transfer/tonService.ts @@ -150,7 +150,6 @@ export const estimateTonTransfer = async ( if (!isMax) { checkWalletPositiveBalanceOrDie(wallet); } - console.log({ seqno }); const cell = createTonTransfer(seqno, walletState, recipient, weiAmount, isMax); @@ -159,6 +158,7 @@ export const estimateTonTransfer = async ( accountId: wallet.address, decodeMessageRequest: { boc: cell.toString('base64') } }); + return { event }; }; diff --git a/yarn.lock b/yarn.lock index c8c6dbbed..43f80bff5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6064,9 +6064,9 @@ __metadata: languageName: node linkType: hard -"@ton/ton@https://github.com/tonkeeper/tonkeeper-ton#build6": +"@ton/ton@https://github.com/tonkeeper/tonkeeper-ton#build8": version: 13.9.0 - resolution: "@ton/ton@https://github.com/tonkeeper/tonkeeper-ton.git#commit=1ee04f1d8bb2daf338717d0e076a4a22fa0babb4" + resolution: "@ton/ton@https://github.com/tonkeeper/tonkeeper-ton.git#commit=e8a7f3415e241daf4ac723f273fbc12776663c49" dependencies: axios: "npm:^0.25.0" dataloader: "npm:^2.0.0" @@ -6076,7 +6076,7 @@ __metadata: peerDependencies: "@ton/core": ">=0.53.0" "@ton/crypto": ">=3.2.0" - checksum: 31193e67ad75bc5ab0a6938e7c5fec093ac0f4ad732f16e9d1cbf54154b7f7345cca7df292e185095dd5df411705eb0a7d46367b089a67419f9418e36d832876 + checksum: b678a719ecee40d0c4a16f88dd0e3a051974ec6431d874c1f8951679727d65fd70688949449c45a84e2b3be4793a6f0b1ee862f4ad8f71b7d77722695d1102c0 languageName: node linkType: hard @@ -6086,7 +6086,7 @@ __metadata: dependencies: "@ton/core": "npm:0.54.0" "@ton/crypto": "npm:3.2.0" - "@ton/ton": "https://github.com/tonkeeper/tonkeeper-ton#build6" + "@ton/ton": "https://github.com/tonkeeper/tonkeeper-ton#build8" bignumber.js: "npm:^9.1.1" ethers: "npm:^6.6.5" npm-run-all: "npm:^4.1.5" From d27e5399811f1997d00d4c3d0d226a597d74d675 Mon Sep 17 00:00:00 2001 From: Nikita Kuznetsov Date: Fri, 22 Mar 2024 15:58:14 +0100 Subject: [PATCH 09/10] Return api --- packages/core/src/entries/network.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/core/src/entries/network.ts b/packages/core/src/entries/network.ts index 36de36d6e..046c2ca1c 100644 --- a/packages/core/src/entries/network.ts +++ b/packages/core/src/entries/network.ts @@ -18,7 +18,7 @@ export const switchNetwork = (current: Network): Network => { export const getTonClientV2 = (config: TonendpointConfig, current?: Network) => { return new ConfigurationV2({ basePath: - current === Network.MAINNET ? 'https://dev.tonapi.io' : 'https://testnet.tonapi.io', + current === Network.MAINNET ? 'https://keeper.tonapi.io' : 'https://testnet.tonapi.io', headers: { Authorization: `Bearer ${config.tonApiV2Key}` } From 16b125ca1c2dfcf05c0f372f90668bca6944f187 Mon Sep 17 00:00:00 2001 From: Nikita Kuznetsov Date: Mon, 25 Mar 2024 14:31:18 +0100 Subject: [PATCH 10/10] Send max with sendMode 130 --- packages/core/src/service/transfer/tonService.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/core/src/service/transfer/tonService.ts b/packages/core/src/service/transfer/tonService.ts index dc4190b0b..7fea2ab6d 100644 --- a/packages/core/src/service/transfer/tonService.ts +++ b/packages/core/src/service/transfer/tonService.ts @@ -97,7 +97,7 @@ const createTonTransfer = ( secretKey, timeout: getTTL(), sendMode: isMax - ? SendMode.CARRY_ALL_REMAINING_BALANCE + ? SendMode.CARRY_ALL_REMAINING_BALANCE + SendMode.IGNORE_ERRORS : SendMode.PAY_GAS_SEPARATELY + SendMode.IGNORE_ERRORS, messages: [ internal({