@tonconnect/sdk 0.0.34 → 0.0.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -2,7 +2,7 @@ export interface SendTransactionRequest {
|
|
|
2
2
|
/**
|
|
3
3
|
* Sending transaction deadline in unix epoch seconds.
|
|
4
4
|
*/
|
|
5
|
-
|
|
5
|
+
validUntil: number;
|
|
6
6
|
/**
|
|
7
7
|
* Messages to send: min is 1, max is 4.
|
|
8
8
|
*/
|
|
@@ -18,7 +18,7 @@ export interface SendTransactionRequest {
|
|
|
18
18
|
/**
|
|
19
19
|
* Contract specific data to add to the transaction.
|
|
20
20
|
*/
|
|
21
|
-
|
|
21
|
+
stateInit?: string;
|
|
22
22
|
/**
|
|
23
23
|
* Contract specific data to add to the transaction.
|
|
24
24
|
*/
|
|
@@ -3,7 +3,9 @@ import { SendTransactionRequest, SendTransactionResponse } from "../models/metho
|
|
|
3
3
|
import { RpcParser } from "./rpc-parser";
|
|
4
4
|
import { WithoutId } from "../utils/types";
|
|
5
5
|
declare class SendTransactionParser extends RpcParser<'sendTransaction'> {
|
|
6
|
-
convertToRpcRequest(request: SendTransactionRequest
|
|
6
|
+
convertToRpcRequest(request: Omit<SendTransactionRequest, 'validUntil'> & {
|
|
7
|
+
valid_until: number;
|
|
8
|
+
}): WithoutId<SendTransactionRpcRequest>;
|
|
7
9
|
parseAndThrowError(response: WithoutId<SendTransactionRpcResponseError>): never;
|
|
8
10
|
convertFromRpcResponse(rpcResponse: WithoutId<SendTransactionRpcResponseSuccess>): SendTransactionResponse;
|
|
9
11
|
}
|
package/lib/ton-connect.js
CHANGED
|
@@ -8,6 +8,17 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
12
|
+
var t = {};
|
|
13
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
14
|
+
t[p] = s[p];
|
|
15
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
16
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
17
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
18
|
+
t[p[i]] = s[p[i]];
|
|
19
|
+
}
|
|
20
|
+
return t;
|
|
21
|
+
};
|
|
11
22
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
23
|
exports.TonConnect = void 0;
|
|
13
24
|
const dapp_metadata_error_1 = require("./errors/dapp/dapp-metadata.error");
|
|
@@ -132,8 +143,9 @@ class TonConnect {
|
|
|
132
143
|
*/
|
|
133
144
|
sendTransaction(transaction) {
|
|
134
145
|
return __awaiter(this, void 0, void 0, function* () {
|
|
146
|
+
const { validUntil } = transaction, tx = __rest(transaction, ["validUntil"]);
|
|
135
147
|
this.checkConnection();
|
|
136
|
-
const response = yield this.provider.sendRequest(send_transaction_parser_1.sendTransactionParser.convertToRpcRequest(
|
|
148
|
+
const response = yield this.provider.sendRequest(send_transaction_parser_1.sendTransactionParser.convertToRpcRequest(Object.assign(Object.assign({}, tx), { valid_until: validUntil })));
|
|
137
149
|
if (send_transaction_parser_1.sendTransactionParser.isError(response)) {
|
|
138
150
|
return send_transaction_parser_1.sendTransactionParser.parseAndThrowError(response);
|
|
139
151
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tonconnect/sdk",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.36",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"build": "npx rimraf lib && ttsc && npx rimraf dist && webpack --mode development",
|
|
6
6
|
"build:production": "npx rimraf lib && ttsc --sourceMap false && npx rimraf dist && webpack --mode production"
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"tweetnacl": "^1.0.3",
|
|
29
29
|
"eventsource": "^2.0.2",
|
|
30
30
|
"node-fetch": "^2.6.7",
|
|
31
|
-
"@tonconnect/protocol": "^0.0.
|
|
31
|
+
"@tonconnect/protocol": "^0.0.21"
|
|
32
32
|
},
|
|
33
33
|
"files": [
|
|
34
34
|
"lib",
|