Please read my post in Telegram: Don't use spread operator with byte arrays
- Use
target.set(source, offset)
MDN - Pre-alocate the entire array once
- Don't use
...spread
operator with bytes
Please read my post in Telegram: Don't use spread operator with byte arrays
target.set(source, offset)
MDN...spread
operator with bytes{ | |
"5.9.10.47:19949": { | |
"errors": { | |
"LITE_SERVER_UNKNOWN: timeout(during last block synchronization)": 2 | |
}, | |
"results": {} | |
}, | |
"5.9.10.15:48014": { | |
"errors": { | |
"LITE_SERVER_NOTREADY: block is not applied": 38, |
/** | |
* This module implements ECMAScript (stage-3) proposal: | |
* Promise with resolvers: | |
* https://github.com/tc39/proposal-promise-with-resolvers | |
* | |
* Copyright 2023 Slava Fomin II | |
* | |
* Permission is hereby granted, free of charge, to any | |
* person obtaining a copy of this software and associated | |
* documentation files (the “Software”), to deal in the |
const isValid$ = ( | |
merge( | |
value$.pipe( | |
distinctUntilChanged(), | |
map(() => undefined), | |
), | |
value$.pipe( | |
debounceTime(500), | |
withLatestFrom(isComplete$), | |
filter(([_, isComplete]) => isComplete), |
import { WebApp } from '@grammyjs/web-app'; | |
export function isTwa(): boolean { | |
return ( | |
Boolean(WebApp.initData) || | |
(WebApp.platform !== 'unknown') | |
); |
{ "foo": 123456789123456789123 } |
This reference guide shows how to configure a TypeScript Node.js project to work and compile to to native ESM.
CommonJS module system was introduced by the Node.js developers due to the lack of the notion of "modules" in the original JavaScript (ECMAScript) language specification at that time. However, nowadays, ECMAScript has a standard module system called ESM — ECMAScript Modules, which is a part of the accepted standard. This way CommonJS could be considered vendor-specific and obsolete/legacy. Hopefully, TypeScript ecosystem now supports the "new" standard.
So the key benefits are:
const provider = new HttpProvider('https://toncenter.com/api/v2/jsonRPC', { | |
apiKey: '…', | |
}); | |
const wallet = new WalletV3ContractR2(provider, { | |
publicKey, | |
}); | |
(async () => { |
import TonWeb from 'tonweb'; | |
(async () => { | |
const tonweb = new TonWeb( | |
new TonWeb.HttpProvider() | |
); |