ton-community / ton Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
Всем привет. Создаю кошелёк, получается. Делаю wallet.wallet.getSeqNo() - вываливается в такую ошибку:
(node:22645) UnhandledPromiseRejectionWarning: Error: Mailformed response: Expecting one of:
number
string
at balance but instead got: undefined, Expecting { @type: "ton.blockIdExt", workchain: number, shard: string, seqno: number, root_hash: string, file_hash: string } at block_id but instead got: undefined, Expecting string at code but instead got: 500, Expecting string at data but instead got: undefined, Expecting { @type: "internal.transactionId", lt: string, hash: string } at last_transaction_id but instead got: undefined, Expecting number at sync_utime but instead got: undefined
at HttpApi.doCall (/tonwhales/node_modules/ton/dist/client/api/HttpApi.js:259:19)
at processTicksAndRejections (internal/process/task_queues.js:95:5)
at TonClient.getContractState (/tonwhales/node_modules/ton/dist/client/TonClient.js:216:20)
at TonClient.isContractDeployed (/tonwhales/node_modules/ton/dist/client/TonClient.js:209:17)
at Function.findActiveBySecretKey (/tonwhales/node_modules/ton/dist/client/Wallet.js:116:28)
at Function.findBestBySecretKey (/tonwhales/node_modules/ton/dist/client/Wallet.js:126:25)
at a (/tonwhales/index.ts:33:19)
В чём может быть проблема? Как бороться?
Some wallets already deploy wallet V4 which is not supported by the library yet
please
I create some cells and want to compare them.
It works if we use constructors like this:
const cell = new Cell().withData("0101");
const cell2 = new Cell().withData("0101");
console.log(cell.equals(cell2)); // true
But it doesn't work if we use Cell.fromBoc
:
const cell = new Cell().withData("0101");
const cellboc = Cell.fromBoc(cell.toBoc())[0];
console.log(cell.equals(cellboc)); // false, but expected true
The problem is that the comparison fails on bits.equals
, because cellboc
has only 8 bits (cellboc.bits.length
), while the first cell has 1023.
Hey guys!
Thank you for your great work!
Here I see that axios
adapter can be passed from the client
configuration, but it doesn't seem to be used anywhere in HttpApi
.
This creates a problem, when in project you have multiple axios
versions, and it's impossible to configure axios
instance which is being used in the client
.
Like in this example:
import axios from 'axios';
import axiosThrottle from 'axios-request-throttle';
axiosThrottle.use(axios, { requestsPerSecond: 0.5 });
axios
used in axiosThrottle
configuration is not the same as the one used by HttpApi
, hence throttling is not applying.
I'd recommend to either actually use the adapter or move axios
from here to peerDependencies
Similar to Ton Web:
<script src="tonweb.js"></script>
const tonweb = new window.TonWeb();
It will be very useful for people building TON apps with toolchains that don't rely on NPM
Hello, im blocked via cloudflare says lolminer, i think reason is lolminer 1.39 reconnect to much, Please help me
my ip is 109.42.113.**
Hi, I'm facing this issue when I'm trying to send requests to https://testnet.toncenter.com/api/v2/jsonRPC
in my react app.
Error message:
Access to XMLHttpRequest at 'https://testnet.toncenter.com/api/v2/jsonRPC' from origin
'http://localhost:3000' has been blocked by CORS policy: Request header field
x-ton-client-version is not allowed by Access-Control-Allow-Headers in preflight response.
I changed the node module file of ton package and deleted one line, and then requests were working well.
PS:
Maybe making this header to be optional is better.
probably it's related to the way js represents numbers. it seems the results of bitwise operations are overflowing
examples
-46 ^ 0x82f63b78 = 2097792170
0 ^ 0xffffffff = -1
There is no support for v4 contracts in the libraries, I think it's worth adding.
Please add breaking changes list (like method removal/rename) to changelog.md or somewhere
Hi, help please with ton^13
callGetMethod return an error "Unsupported stack item type: list" when dictionary is empty.
How can I read data with empty dictionary correctly?
p.s. ton^12 doesn't have this problem
Hey guys!
Thank you for your great work!
I'm new to ton.
I'm trying to retrieve the public address that personal sign, but I can't find any function or information in ton's sdk.
In ethereum it would be something like
const msgHash = ethers.utils.hashMessage(msg);
const msgHashBytes = ethers.utils.arrayify(msgHash);
const recoveredPubKey = ethers.utils.recoverPublicKey(msgHashBytes, signature);
const recoveredAddress = ethers.utils.recoverAddress(msgHashBytes, signature);
console.log("publickey",recoveredPubKey)
console.log("redover address", recoveredAddress)
What would be the equivalent in Ton? or where I can get information, I have searched but I can't find anything about it
Regards
In: https://github.com/tonwhales/ton/blob/master/src/messages/BinaryMessage.ts
binary comments are not handled according to guidelines: https://ton.org/docs/#/howto/smart-contract-guidelines
If op is zero, then the message is a "simple transfer message with comment". The comment is contained in the remainder of the message body (without any query_id field, i.e., starting from the fifth byte). If it does not begin with the byte 0xff, the comment is a text one; ... On the other hand, if the comment begins with the byte 0xff, the remainder is a "binary comment"
In other words, need bytes 0x00000000FF before writing buffer
Suggested fix:
writeTo(cell: Cell) {
cell.bits.writeUint(0, 32);
cell.bits.writeUint(0xFF, 8);
cell.bits.writeBuffer(this.payload);
}
Another issue is handling big binary comments which don't into one cell.
The case of big messages is handled in for text comments in CommentMessage.ts, but not for binary comments.
Hello!
Is there a way to calculate transaction fee using this library?
What would be the recommended way to check if account has enough funds to carry on the funds transfer?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.