@ardrive/turbo-sdk 1.5.0-alpha.1 → 1.5.0-alpha.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/bundles/web.bundle.min.js +14932 -12597
- package/lib/cjs/common/http.js +6 -2
- package/lib/cjs/common/payment.js +12 -10
- package/lib/cjs/common/signer.js +7 -1
- package/lib/cjs/common/token.js +32 -32
- package/lib/cjs/utils/common.js +23 -0
- package/lib/cjs/version.js +1 -1
- package/lib/esm/common/http.js +6 -2
- package/lib/esm/common/payment.js +12 -10
- package/lib/esm/common/signer.js +8 -0
- package/lib/esm/common/token.js +32 -32
- package/lib/esm/utils/common.js +19 -0
- package/lib/esm/version.js +1 -1
- package/lib/types/common/http.d.ts.map +1 -1
- package/lib/types/common/logger.d.ts +4 -4
- package/lib/types/common/logger.d.ts.map +1 -1
- package/lib/types/common/payment.d.ts.map +1 -1
- package/lib/types/common/signer.d.ts +24 -0
- package/lib/types/common/signer.d.ts.map +1 -1
- package/lib/types/common/token.d.ts +5 -14
- package/lib/types/common/token.d.ts.map +1 -1
- package/lib/types/types.d.ts +2 -5
- package/lib/types/types.d.ts.map +1 -1
- package/lib/types/utils/common.d.ts +18 -0
- package/lib/types/utils/common.d.ts.map +1 -0
- package/lib/types/version.d.ts +1 -1
- package/lib/types/version.d.ts.map +1 -1
- package/package.json +6 -4
package/lib/cjs/common/http.js
CHANGED
@@ -31,7 +31,9 @@ class TurboHTTPService {
|
|
31
31
|
signal,
|
32
32
|
});
|
33
33
|
if (!allowedStatuses.includes(status)) {
|
34
|
-
throw new errors_js_1.FailedRequestError(status,
|
34
|
+
throw new errors_js_1.FailedRequestError(status,
|
35
|
+
// Return error message from server if available
|
36
|
+
typeof data === 'string' ? data : statusText);
|
35
37
|
}
|
36
38
|
return data;
|
37
39
|
}
|
@@ -41,7 +43,9 @@ class TurboHTTPService {
|
|
41
43
|
signal,
|
42
44
|
});
|
43
45
|
if (!allowedStatuses.includes(status)) {
|
44
|
-
throw new errors_js_1.FailedRequestError(status,
|
46
|
+
throw new errors_js_1.FailedRequestError(status,
|
47
|
+
// Return error message from server if available
|
48
|
+
typeof data === 'string' ? data : statusText);
|
45
49
|
}
|
46
50
|
return response;
|
47
51
|
}
|
@@ -173,31 +173,33 @@ class TurboAuthenticatedPaymentService extends TurboUnauthenticatedPaymentServic
|
|
173
173
|
return walletAddress;
|
174
174
|
}
|
175
175
|
async topUpWithTokens({ feeMultiplier = 1, tokenAmount: tokenAmountV, }) {
|
176
|
-
this.logger.debug('Funding account...');
|
177
176
|
const tokenAmount = new bignumber_js_1.BigNumber(tokenAmountV);
|
178
177
|
const target = await this.getTargetWalletForFund();
|
179
|
-
|
178
|
+
this.logger.debug('Funding account...', {
|
179
|
+
feeMultiplier,
|
180
|
+
tokenAmount,
|
181
|
+
target,
|
182
|
+
});
|
183
|
+
const fundTx = await this.tokenMap[this.token].createSignedTx({
|
180
184
|
target,
|
181
185
|
tokenAmount,
|
182
186
|
feeMultiplier,
|
183
|
-
});
|
184
|
-
const signedTx = await this.tokenMap[this.token].signTx({
|
185
|
-
tx: fundTx,
|
186
187
|
signer: this.signer,
|
187
188
|
});
|
188
|
-
|
189
|
-
|
189
|
+
const txId = fundTx.id;
|
190
|
+
this.logger.debug('Submitting fund transaction...', { txId });
|
191
|
+
await this.tokenMap[this.token].submitTx({ tx: fundTx });
|
190
192
|
try {
|
191
193
|
// Let transaction settle some time
|
192
194
|
await this.tokenMap[this.token].pollForTxBeingAvailable({ txId });
|
193
195
|
return {
|
194
196
|
...(await this.submitFundTransaction({ txId })),
|
195
|
-
target:
|
196
|
-
reward:
|
197
|
+
target: fundTx.target,
|
198
|
+
reward: fundTx.reward,
|
197
199
|
};
|
198
200
|
}
|
199
201
|
catch (e) {
|
200
|
-
this.logger.
|
202
|
+
this.logger.debug('Failed to submit fund transaction...', e);
|
201
203
|
throw Error(`Failed to submit fund transaction! Save this Transaction ID and try again with 'turbo.submitFundTransaction(id)': ${txId}`);
|
202
204
|
}
|
203
205
|
}
|
package/lib/cjs/common/signer.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.TurboDataItemAbstractSigner = void 0;
|
3
|
+
exports.TurboDataItemAbstractSigner = exports.ArweaveSigner = exports.ArconnectSigner = void 0;
|
4
4
|
/**
|
5
5
|
* Copyright (C) 2022-2023 Permanent Data Solutions, Inc. All Rights Reserved.
|
6
6
|
*
|
@@ -17,8 +17,14 @@ exports.TurboDataItemAbstractSigner = void 0;
|
|
17
17
|
* You should have received a copy of the GNU Affero General Public License
|
18
18
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
19
19
|
*/
|
20
|
+
const arbundles_1 = require("arbundles");
|
21
|
+
Object.defineProperty(exports, "ArconnectSigner", { enumerable: true, get: function () { return arbundles_1.ArconnectSigner; } });
|
22
|
+
Object.defineProperty(exports, "ArweaveSigner", { enumerable: true, get: function () { return arbundles_1.ArweaveSigner; } });
|
20
23
|
const crypto_1 = require("crypto");
|
21
24
|
const base64_js_1 = require("../utils/base64.js");
|
25
|
+
/**
|
26
|
+
* Abstract class for signing TurboDataItems.
|
27
|
+
*/
|
22
28
|
class TurboDataItemAbstractSigner {
|
23
29
|
constructor({ signer, logger }) {
|
24
30
|
this.logger = logger;
|
package/lib/cjs/common/token.js
CHANGED
@@ -20,15 +20,14 @@ exports.ARToTokenAmount = exports.WinstonToTokenAmount = exports.ArweaveToken =
|
|
20
20
|
* You should have received a copy of the GNU Affero General Public License
|
21
21
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
22
22
|
*/
|
23
|
-
const arweave_1 = __importDefault(require("arweave"));
|
23
|
+
const arweave_1 = __importDefault(require("@irys/arweave"));
|
24
24
|
const bignumber_js_1 = require("bignumber.js");
|
25
25
|
const base64_js_1 = require("../utils/base64.js");
|
26
|
+
const common_js_1 = require("../utils/common.js");
|
26
27
|
const logger_js_1 = require("./logger.js");
|
27
28
|
class ArweaveToken {
|
28
29
|
constructor({ arweave = arweave_1.default.init({
|
29
|
-
|
30
|
-
port: 443,
|
31
|
-
protocol: 'https',
|
30
|
+
url: 'https://arweave.net',
|
32
31
|
}), logger = new logger_js_1.TurboWinstonLogger(), mintU = true, pollingOptions = {
|
33
32
|
maxAttempts: 10,
|
34
33
|
pollingIntervalMs: 3000,
|
@@ -39,7 +38,7 @@ class ArweaveToken {
|
|
39
38
|
this.mintU = mintU;
|
40
39
|
this.pollingOptions = pollingOptions;
|
41
40
|
}
|
42
|
-
async
|
41
|
+
async createSignedTx({ feeMultiplier, target, tokenAmount, signer, }) {
|
43
42
|
const tx = await this.arweave.createTransaction({
|
44
43
|
target,
|
45
44
|
quantity: tokenAmount.toString(),
|
@@ -56,9 +55,6 @@ class ArweaveToken {
|
|
56
55
|
tx.addTag('Contract', 'KTzTXT_ANmF84fWEKHzWURD1LWd9QaFR9yfYUwH2Lxw'); // cspell:enable
|
57
56
|
tx.addTag('Input', JSON.stringify({ function: 'mint' }));
|
58
57
|
}
|
59
|
-
return tx;
|
60
|
-
}
|
61
|
-
async signTx({ tx, signer, }) {
|
62
58
|
const publicKeyB64Url = (0, base64_js_1.toB64Url)(await signer.getPublicKey());
|
63
59
|
tx.setOwner(publicKeyB64Url);
|
64
60
|
const dataToSign = await tx.getSignatureData();
|
@@ -73,12 +69,15 @@ class ArweaveToken {
|
|
73
69
|
}
|
74
70
|
async pollForTxBeingAvailable({ txId, }) {
|
75
71
|
const { maxAttempts, pollingIntervalMs, initialBackoffMs } = this.pollingOptions;
|
76
|
-
|
72
|
+
this.logger.debug('Polling for transaction...', { txId });
|
73
|
+
await (0, common_js_1.sleep)(initialBackoffMs);
|
77
74
|
let attempts = 0;
|
78
75
|
while (attempts < maxAttempts) {
|
79
|
-
|
80
|
-
|
81
|
-
|
76
|
+
let transaction;
|
77
|
+
attempts++;
|
78
|
+
try {
|
79
|
+
const response = await this.arweave.api.post('/graphql', {
|
80
|
+
query: `
|
82
81
|
query {
|
83
82
|
transaction(id: "${txId}") {
|
84
83
|
recipient
|
@@ -90,37 +89,38 @@ class ArweaveToken {
|
|
90
89
|
}
|
91
90
|
}
|
92
91
|
}
|
93
|
-
|
94
|
-
|
95
|
-
|
92
|
+
`,
|
93
|
+
});
|
94
|
+
transaction = response?.data?.data?.transaction;
|
95
|
+
}
|
96
|
+
catch (err) {
|
96
97
|
// Continue retries when request errors
|
97
|
-
this.logger.
|
98
|
-
|
99
|
-
});
|
100
|
-
const transaction = response?.data?.data?.transaction;
|
98
|
+
this.logger.debug('Failed to poll for transaction...', { err });
|
99
|
+
}
|
101
100
|
if (transaction) {
|
102
101
|
return;
|
103
102
|
}
|
104
|
-
|
105
|
-
this.logger.debug('Transaction not found after polling...', {
|
103
|
+
this.logger.debug('Transaction not found...', {
|
106
104
|
txId,
|
107
105
|
attempts,
|
106
|
+
maxAttempts,
|
107
|
+
pollingIntervalMs,
|
108
108
|
});
|
109
|
-
await
|
109
|
+
await (0, common_js_1.sleep)(pollingIntervalMs);
|
110
110
|
}
|
111
111
|
throw new Error('Transaction not found after polling, transaction id: ' + txId);
|
112
112
|
}
|
113
113
|
async submitTx({ tx }) {
|
114
|
-
|
115
|
-
this.
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
}
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
114
|
+
try {
|
115
|
+
const response = await this.arweave.transactions.post(tx);
|
116
|
+
if (response.status !== 200) {
|
117
|
+
throw new Error('Failed to post transaction -- ' +
|
118
|
+
`Status ${response.status}, ${response.statusText}`);
|
119
|
+
}
|
120
|
+
this.logger.debug('Successfully posted fund transaction...', { tx });
|
121
|
+
}
|
122
|
+
catch (err) {
|
123
|
+
throw new Error(`Failed to post transaction -- ${err instanceof Error ? err.message : err}`);
|
124
124
|
}
|
125
125
|
this.logger.debug('Posted transaction...', { tx });
|
126
126
|
}
|
@@ -0,0 +1,23 @@
|
|
1
|
+
"use strict";
|
2
|
+
/**
|
3
|
+
* Copyright (C) 2022-2023 Permanent Data Solutions, Inc. All Rights Reserved.
|
4
|
+
*
|
5
|
+
* This program is free software: you can redistribute it and/or modify
|
6
|
+
* it under the terms of the GNU Affero General Public License as published by
|
7
|
+
* the Free Software Foundation, either version 3 of the License, or
|
8
|
+
* (at your option) any later version.
|
9
|
+
*
|
10
|
+
* This program is distributed in the hope that it will be useful,
|
11
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
13
|
+
* GNU Affero General Public License for more details.
|
14
|
+
*
|
15
|
+
* You should have received a copy of the GNU Affero General Public License
|
16
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
17
|
+
*/
|
18
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
19
|
+
exports.sleep = void 0;
|
20
|
+
function sleep(ms) {
|
21
|
+
return new Promise((resolve) => setTimeout(resolve, ms));
|
22
|
+
}
|
23
|
+
exports.sleep = sleep;
|
package/lib/cjs/version.js
CHANGED
package/lib/esm/common/http.js
CHANGED
@@ -28,7 +28,9 @@ export class TurboHTTPService {
|
|
28
28
|
signal,
|
29
29
|
});
|
30
30
|
if (!allowedStatuses.includes(status)) {
|
31
|
-
throw new FailedRequestError(status,
|
31
|
+
throw new FailedRequestError(status,
|
32
|
+
// Return error message from server if available
|
33
|
+
typeof data === 'string' ? data : statusText);
|
32
34
|
}
|
33
35
|
return data;
|
34
36
|
}
|
@@ -38,7 +40,9 @@ export class TurboHTTPService {
|
|
38
40
|
signal,
|
39
41
|
});
|
40
42
|
if (!allowedStatuses.includes(status)) {
|
41
|
-
throw new FailedRequestError(status,
|
43
|
+
throw new FailedRequestError(status,
|
44
|
+
// Return error message from server if available
|
45
|
+
typeof data === 'string' ? data : statusText);
|
42
46
|
}
|
43
47
|
return response;
|
44
48
|
}
|
@@ -169,31 +169,33 @@ export class TurboAuthenticatedPaymentService extends TurboUnauthenticatedPaymen
|
|
169
169
|
return walletAddress;
|
170
170
|
}
|
171
171
|
async topUpWithTokens({ feeMultiplier = 1, tokenAmount: tokenAmountV, }) {
|
172
|
-
this.logger.debug('Funding account...');
|
173
172
|
const tokenAmount = new BigNumber(tokenAmountV);
|
174
173
|
const target = await this.getTargetWalletForFund();
|
175
|
-
|
174
|
+
this.logger.debug('Funding account...', {
|
175
|
+
feeMultiplier,
|
176
|
+
tokenAmount,
|
177
|
+
target,
|
178
|
+
});
|
179
|
+
const fundTx = await this.tokenMap[this.token].createSignedTx({
|
176
180
|
target,
|
177
181
|
tokenAmount,
|
178
182
|
feeMultiplier,
|
179
|
-
});
|
180
|
-
const signedTx = await this.tokenMap[this.token].signTx({
|
181
|
-
tx: fundTx,
|
182
183
|
signer: this.signer,
|
183
184
|
});
|
184
|
-
|
185
|
-
|
185
|
+
const txId = fundTx.id;
|
186
|
+
this.logger.debug('Submitting fund transaction...', { txId });
|
187
|
+
await this.tokenMap[this.token].submitTx({ tx: fundTx });
|
186
188
|
try {
|
187
189
|
// Let transaction settle some time
|
188
190
|
await this.tokenMap[this.token].pollForTxBeingAvailable({ txId });
|
189
191
|
return {
|
190
192
|
...(await this.submitFundTransaction({ txId })),
|
191
|
-
target:
|
192
|
-
reward:
|
193
|
+
target: fundTx.target,
|
194
|
+
reward: fundTx.reward,
|
193
195
|
};
|
194
196
|
}
|
195
197
|
catch (e) {
|
196
|
-
this.logger.
|
198
|
+
this.logger.debug('Failed to submit fund transaction...', e);
|
197
199
|
throw Error(`Failed to submit fund transaction! Save this Transaction ID and try again with 'turbo.submitFundTransaction(id)': ${txId}`);
|
198
200
|
}
|
199
201
|
}
|
package/lib/esm/common/signer.js
CHANGED
@@ -14,8 +14,16 @@
|
|
14
14
|
* You should have received a copy of the GNU Affero General Public License
|
15
15
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
16
16
|
*/
|
17
|
+
import { ArconnectSigner, ArweaveSigner } from 'arbundles';
|
17
18
|
import { randomBytes } from 'crypto';
|
18
19
|
import { toB64Url } from '../utils/base64.js';
|
20
|
+
/**
|
21
|
+
* Utility exports to avoid clients having to install arbundles
|
22
|
+
*/
|
23
|
+
export { ArconnectSigner, ArweaveSigner };
|
24
|
+
/**
|
25
|
+
* Abstract class for signing TurboDataItems.
|
26
|
+
*/
|
19
27
|
export class TurboDataItemAbstractSigner {
|
20
28
|
constructor({ signer, logger }) {
|
21
29
|
this.logger = logger;
|
package/lib/esm/common/token.js
CHANGED
@@ -14,15 +14,14 @@
|
|
14
14
|
* You should have received a copy of the GNU Affero General Public License
|
15
15
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
16
16
|
*/
|
17
|
-
import Arweave from 'arweave';
|
17
|
+
import Arweave from '@irys/arweave';
|
18
18
|
import { BigNumber } from 'bignumber.js';
|
19
19
|
import { sha256B64Url, toB64Url } from '../utils/base64.js';
|
20
|
+
import { sleep } from '../utils/common.js';
|
20
21
|
import { TurboWinstonLogger } from './logger.js';
|
21
22
|
export class ArweaveToken {
|
22
23
|
constructor({ arweave = Arweave.init({
|
23
|
-
|
24
|
-
port: 443,
|
25
|
-
protocol: 'https',
|
24
|
+
url: 'https://arweave.net',
|
26
25
|
}), logger = new TurboWinstonLogger(), mintU = true, pollingOptions = {
|
27
26
|
maxAttempts: 10,
|
28
27
|
pollingIntervalMs: 3000,
|
@@ -33,7 +32,7 @@ export class ArweaveToken {
|
|
33
32
|
this.mintU = mintU;
|
34
33
|
this.pollingOptions = pollingOptions;
|
35
34
|
}
|
36
|
-
async
|
35
|
+
async createSignedTx({ feeMultiplier, target, tokenAmount, signer, }) {
|
37
36
|
const tx = await this.arweave.createTransaction({
|
38
37
|
target,
|
39
38
|
quantity: tokenAmount.toString(),
|
@@ -50,9 +49,6 @@ export class ArweaveToken {
|
|
50
49
|
tx.addTag('Contract', 'KTzTXT_ANmF84fWEKHzWURD1LWd9QaFR9yfYUwH2Lxw'); // cspell:enable
|
51
50
|
tx.addTag('Input', JSON.stringify({ function: 'mint' }));
|
52
51
|
}
|
53
|
-
return tx;
|
54
|
-
}
|
55
|
-
async signTx({ tx, signer, }) {
|
56
52
|
const publicKeyB64Url = toB64Url(await signer.getPublicKey());
|
57
53
|
tx.setOwner(publicKeyB64Url);
|
58
54
|
const dataToSign = await tx.getSignatureData();
|
@@ -67,12 +63,15 @@ export class ArweaveToken {
|
|
67
63
|
}
|
68
64
|
async pollForTxBeingAvailable({ txId, }) {
|
69
65
|
const { maxAttempts, pollingIntervalMs, initialBackoffMs } = this.pollingOptions;
|
70
|
-
|
66
|
+
this.logger.debug('Polling for transaction...', { txId });
|
67
|
+
await sleep(initialBackoffMs);
|
71
68
|
let attempts = 0;
|
72
69
|
while (attempts < maxAttempts) {
|
73
|
-
|
74
|
-
|
75
|
-
|
70
|
+
let transaction;
|
71
|
+
attempts++;
|
72
|
+
try {
|
73
|
+
const response = await this.arweave.api.post('/graphql', {
|
74
|
+
query: `
|
76
75
|
query {
|
77
76
|
transaction(id: "${txId}") {
|
78
77
|
recipient
|
@@ -84,37 +83,38 @@ export class ArweaveToken {
|
|
84
83
|
}
|
85
84
|
}
|
86
85
|
}
|
87
|
-
|
88
|
-
|
89
|
-
|
86
|
+
`,
|
87
|
+
});
|
88
|
+
transaction = response?.data?.data?.transaction;
|
89
|
+
}
|
90
|
+
catch (err) {
|
90
91
|
// Continue retries when request errors
|
91
|
-
this.logger.
|
92
|
-
|
93
|
-
});
|
94
|
-
const transaction = response?.data?.data?.transaction;
|
92
|
+
this.logger.debug('Failed to poll for transaction...', { err });
|
93
|
+
}
|
95
94
|
if (transaction) {
|
96
95
|
return;
|
97
96
|
}
|
98
|
-
|
99
|
-
this.logger.debug('Transaction not found after polling...', {
|
97
|
+
this.logger.debug('Transaction not found...', {
|
100
98
|
txId,
|
101
99
|
attempts,
|
100
|
+
maxAttempts,
|
101
|
+
pollingIntervalMs,
|
102
102
|
});
|
103
|
-
await
|
103
|
+
await sleep(pollingIntervalMs);
|
104
104
|
}
|
105
105
|
throw new Error('Transaction not found after polling, transaction id: ' + txId);
|
106
106
|
}
|
107
107
|
async submitTx({ tx }) {
|
108
|
-
|
109
|
-
this.
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
}
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
108
|
+
try {
|
109
|
+
const response = await this.arweave.transactions.post(tx);
|
110
|
+
if (response.status !== 200) {
|
111
|
+
throw new Error('Failed to post transaction -- ' +
|
112
|
+
`Status ${response.status}, ${response.statusText}`);
|
113
|
+
}
|
114
|
+
this.logger.debug('Successfully posted fund transaction...', { tx });
|
115
|
+
}
|
116
|
+
catch (err) {
|
117
|
+
throw new Error(`Failed to post transaction -- ${err instanceof Error ? err.message : err}`);
|
118
118
|
}
|
119
119
|
this.logger.debug('Posted transaction...', { tx });
|
120
120
|
}
|
@@ -0,0 +1,19 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright (C) 2022-2023 Permanent Data Solutions, Inc. All Rights Reserved.
|
3
|
+
*
|
4
|
+
* This program is free software: you can redistribute it and/or modify
|
5
|
+
* it under the terms of the GNU Affero General Public License as published by
|
6
|
+
* the Free Software Foundation, either version 3 of the License, or
|
7
|
+
* (at your option) any later version.
|
8
|
+
*
|
9
|
+
* This program is distributed in the hope that it will be useful,
|
10
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
11
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
12
|
+
* GNU Affero General Public License for more details.
|
13
|
+
*
|
14
|
+
* You should have received a copy of the GNU Affero General Public License
|
15
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
16
|
+
*/
|
17
|
+
export function sleep(ms) {
|
18
|
+
return new Promise((resolve) => setTimeout(resolve, ms));
|
19
|
+
}
|
package/lib/esm/version.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../../../src/common/http.ts"],"names":[],"mappings":";;;AAAA;;;;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,EACzB,WAAW,EACX,yBAAyB,EAC1B,MAAM,aAAa,CAAC;AAIrB,qBAAa,gBAAiB,YAAW,yBAAyB;IAChE,SAAS,CAAC,KAAK,EAAE,aAAa,CAAC;IAC/B,SAAS,CAAC,MAAM,EAAE,WAAW,CAAC;gBAElB,EACV,GAAG,EACH,WAAW,EACX,MAAM,GACP,EAAE;QACD,GAAG,EAAE,MAAM,CAAC;QACZ,WAAW,CAAC,EAAE,iBAAiB,CAAC;QAChC,MAAM,EAAE,WAAW,CAAC;KACrB;IAqBK,GAAG,CAAC,CAAC,EAAE,EACX,QAAQ,EACR,MAAM,EACN,eAA4B,EAC5B,OAAO,GACR,EAAE;QACD,QAAQ,EAAE,MAAM,CAAC;QACjB,MAAM,CAAC,EAAE,WAAW,CAAC;QACrB,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;QAC3B,OAAO,CAAC,EAAE,OAAO,CAAC,yBAAyB,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;KACvE,GAAG,OAAO,CAAC,CAAC,CAAC;IAiBR,IAAI,CAAC,CAAC,EAAE,EACZ,QAAQ,EACR,MAAM,EACN,eAA4B,EAC5B,OAAO,EACP,IAAI,GACL,EAAE;QACD,QAAQ,EAAE,MAAM,CAAC;QACjB,MAAM,CAAC,EAAE,WAAW,CAAC;QACrB,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;QAC3B,OAAO,CAAC,EAAE,OAAO,CAAC,yBAAyB,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QACtE,IAAI,EAAE,QAAQ,GAAG,MAAM,GAAG,cAAc,CAAC;KAC1C,GAAG,OAAO,CAAC,CAAC,CAAC;CAoBf"}
|
@@ -22,10 +22,10 @@ export declare class TurboWinstonLogger implements TurboLogger {
|
|
22
22
|
level?: 'info' | 'debug' | 'error' | 'none' | undefined;
|
23
23
|
logFormat?: 'simple' | 'json' | undefined;
|
24
24
|
});
|
25
|
-
info(message: string, ...args:
|
26
|
-
warn(message: string, ...args:
|
27
|
-
error(message: string, ...args:
|
28
|
-
debug(message: string, ...args:
|
25
|
+
info(message: string, ...args: unknown[]): void;
|
26
|
+
warn(message: string, ...args: unknown[]): void;
|
27
|
+
error(message: string, ...args: unknown[]): void;
|
28
|
+
debug(message: string, ...args: unknown[]): void;
|
29
29
|
setLogLevel(level: string): void;
|
30
30
|
setLogFormat(logFormat: string): void;
|
31
31
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../../src/common/logger.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,OAA6C,MAAM,SAAS,CAAC;AAEpE,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAG1C,qBAAa,kBAAmB,YAAW,WAAW;IACpD,SAAS,CAAC,MAAM,EAAE,OAAO,CAAC,MAAM,CAAC;gBACrB,EACV,KAAc,EACd,SAAoB,GACrB,GAAE;QACD,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,OAAO,GAAG,MAAM,GAAG,SAAS,CAAC;QACxD,SAAS,CAAC,EAAE,QAAQ,GAAG,MAAM,GAAG,SAAS,CAAC;KACtC;IAUN,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,
|
1
|
+
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../../src/common/logger.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,OAA6C,MAAM,SAAS,CAAC;AAEpE,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAG1C,qBAAa,kBAAmB,YAAW,WAAW;IACpD,SAAS,CAAC,MAAM,EAAE,OAAO,CAAC,MAAM,CAAC;gBACrB,EACV,KAAc,EACd,SAAoB,GACrB,GAAE;QACD,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,OAAO,GAAG,MAAM,GAAG,S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,CAAC;IAShD,qBAAqB,CAChC,MAAM,EAAE,0BAA0B,GACjC,OAAO,CAAC,4BAA4B,CAAC;YAO1B,sBAAsB;IAYvB,eAAe,CAAC,EAC3B,aAAiB,EACjB,WAAW,EAAE,YAAY,GAC1B,EAAE,yBAAyB,GAAG,OAAO,CAAC,uBAAuB,CAAC;CAuChE"}
|
@@ -1,5 +1,29 @@
|
|
1
1
|
/// <reference types="node" />
|
2
|
+
/**
|
3
|
+
* Copyright (C) 2022-2023 Permanent Data Solutions, Inc. All Rights Reserved.
|
4
|
+
*
|
5
|
+
* This program is free software: you can redistribute it and/or modify
|
6
|
+
* it under the terms of the GNU Affero General Public License as published by
|
7
|
+
* the Free Software Foundation, either version 3 of the License, or
|
8
|
+
* (at your option) any later version.
|
9
|
+
*
|
10
|
+
* This program is distributed in the hope that it will be useful,
|
11
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
13
|
+
* GNU Affero General Public License for more details.
|
14
|
+
*
|
15
|
+
* You should have received a copy of the GNU Affero General Public License
|
16
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
17
|
+
*/
|
18
|
+
import { ArconnectSigner, ArweaveSigner } from 'arbundles';
|
2
19
|
import { FileStreamFactory, TurboDataItemSigner, TurboDataItemSignerParams, TurboFileFactory, TurboLogger, TurboSignedDataItemFactory, TurboSigner } from '../types.js';
|
20
|
+
/**
|
21
|
+
* Utility exports to avoid clients having to install arbundles
|
22
|
+
*/
|
23
|
+
export { ArconnectSigner, ArweaveSigner };
|
24
|
+
/**
|
25
|
+
* Abstract class for signing TurboDataItems.
|
26
|
+
*/
|
3
27
|
export declare abstract class TurboDataItemAbstractSigner implements TurboDataItemSigner {
|
4
28
|
abstract signDataItem({ fileStreamFactory, fileSizeFactory, dataItemOpts, }: TurboFileFactory<FileStreamFactory>): Promise<TurboSignedDataItemFactory>;
|
5
29
|
protected logger: TurboLogger;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"signer.d.ts","sourceRoot":"","sources":["../../../src/common/signer.ts"],"names":[],"mappings":";
|
1
|
+
{"version":3,"file":"signer.d.ts","sourceRoot":"","sources":["../../../src/common/signer.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAG3D,OAAO,EACL,iBAAiB,EACjB,mBAAmB,EACnB,yBAAyB,EACzB,gBAAgB,EAChB,WAAW,EACX,0BAA0B,EAC1B,WAAW,EACZ,MAAM,aAAa,CAAC;AAGrB;;GAEG;AACH,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,CAAC;AAE1C;;GAEG;AACH,8BAAsB,2BACpB,YAAW,mBAAmB;IAE9B,QAAQ,CAAC,YAAY,CAAC,EACpB,iBAAiB,EACjB,eAAe,EACf,YAAY,GACb,EAAE,gBAAgB,CAAC,iBAAiB,CAAC,GAAG,OAAO,CAAC,0BAA0B,CAAC;IAE5E,SAAS,CAAC,MAAM,EAAE,WAAW,CAAC;IAC9B,SAAS,CAAC,MAAM,EAAE,WAAW,CAAC;gBAElB,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,yBAAyB;IAK5C,4BAA4B;;;;;IAY5B,YAAY,IAAI,OAAO,CAAC,MAAM,CAAC;IAI/B,QAAQ,CAAC,UAAU,EAAE,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC;CAGnE"}
|
@@ -14,16 +14,15 @@
|
|
14
14
|
* You should have received a copy of the GNU Affero General Public License
|
15
15
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
16
16
|
*/
|
17
|
-
import Arweave from 'arweave';
|
18
|
-
import * as Transaction from 'arweave/node/lib/transaction.js';
|
17
|
+
import Arweave from '@irys/arweave';
|
19
18
|
import { BigNumber } from 'bignumber.js';
|
20
|
-
import {
|
19
|
+
import { BaseTx, TokenCreateTxParams, TokenTools, TurboLogger } from '../types.js';
|
21
20
|
type PollingOptions = {
|
22
21
|
maxAttempts: number;
|
23
22
|
pollingIntervalMs: number;
|
24
23
|
initialBackoffMs: number;
|
25
24
|
};
|
26
|
-
export declare class ArweaveToken implements TokenTools
|
25
|
+
export declare class ArweaveToken implements TokenTools {
|
27
26
|
protected logger: TurboLogger;
|
28
27
|
protected arweave: Arweave;
|
29
28
|
protected mintU: boolean;
|
@@ -34,20 +33,12 @@ export declare class ArweaveToken implements TokenTools<Transaction.default> {
|
|
34
33
|
mintU?: boolean;
|
35
34
|
pollingOptions?: PollingOptions;
|
36
35
|
});
|
37
|
-
|
38
|
-
target: string;
|
39
|
-
tokenAmount: BigNumber;
|
40
|
-
feeMultiplier: number;
|
41
|
-
}): Promise<Transaction.default>;
|
42
|
-
signTx({ tx, signer, }: {
|
43
|
-
tx: Transaction.default;
|
44
|
-
signer: TurboDataItemSigner;
|
45
|
-
}): Promise<Transaction.default>;
|
36
|
+
createSignedTx({ feeMultiplier, target, tokenAmount, signer, }: TokenCreateTxParams): Promise<BaseTx>;
|
46
37
|
pollForTxBeingAvailable({ txId, }: {
|
47
38
|
txId: string;
|
48
39
|
}): Promise<void>;
|
49
40
|
submitTx({ tx }: {
|
50
|
-
tx:
|
41
|
+
tx: BaseTx;
|
51
42
|
}): Promise<void>;
|
52
43
|
}
|
53
44
|
export declare const WinstonToTokenAmount: (winston: BigNumber.Value) => BigNumber.Value;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"token.d.ts","sourceRoot":"","sources":["../../../src/common/token.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,OAAO,MAAM,
|
1
|
+
{"version":3,"file":"token.d.ts","sourceRoot":"","sources":["../../../src/common/token.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,OAAO,MAAM,eAAe,CAAC;AACpC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,OAAO,EACL,MAAM,EACN,mBAAmB,EACnB,UAAU,EACV,WAAW,EACZ,MAAM,aAAa,CAAC;AAKrB,KAAK,cAAc,GAAG;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,gBAAgB,EAAE,MAAM,CAAC;CAC1B,CAAC;AAEF,qBAAa,YAAa,YAAW,UAAU;IAC7C,SAAS,CAAC,MAAM,EAAE,WAAW,CAAC;IAC9B,SAAS,CAAC,OAAO,EAAE,OAAO,CAAC;IAC3B,SAAS,CAAC,KAAK,EAAE,OAAO,CAAC;IACzB,SAAS,CAAC,cAAc,EAAE,cAAc,CAAC;gBAE7B,EACV,OAEE,EACF,MAAiC,EACjC,KAAY,EACZ,cAIC,GACF,EAAE;QACD,OAAO,CAAC,EAAE,OAAO,CAAC;QAClB,MAAM,CAAC,EAAE,WAAW,CAAC;QACrB,KAAK,CAAC,EAAE,OAAO,CAAC;QAChB,cAAc,CAAC,EAAE,cAAc,CAAC;KACjC;IAOY,cAAc,CAAC,EAC1B,aAAa,EACb,MAAM,EACN,WAAW,EACX,MAAM,GACP,EAAE,mBAAmB,GAAG,OAAO,CAAC,MAAM,CAAC;IAqC3B,uBAAuB,CAAC,EACnC,IAAI,GACL,EAAE;QACD,IAAI,EAAE,MAAM,CAAC;KACd,GAAG,OAAO,CAAC,IAAI,CAAC;IAoDJ,QAAQ,CAAC,EAAE,EAAE,EAAE,EAAE;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC;CAqB7D;AAED,eAAO,MAAM,oBAAoB,YAAa,UAAU,KAAK,oBAAY,CAAC;AAC1E,eAAO,MAAM,eAAe,OAAQ,UAAU,KAAK,WACV,CAAC"}
|
package/lib/types/types.d.ts
CHANGED
@@ -284,6 +284,7 @@ export type TokenCreateTxParams = {
|
|
284
284
|
target: string;
|
285
285
|
tokenAmount: BigNumber;
|
286
286
|
feeMultiplier: number;
|
287
|
+
signer: TurboDataItemSigner;
|
287
288
|
};
|
288
289
|
export type BaseTx = {
|
289
290
|
id: string;
|
@@ -291,11 +292,7 @@ export type BaseTx = {
|
|
291
292
|
reward: string;
|
292
293
|
};
|
293
294
|
export interface TokenTools<T extends BaseTx = BaseTx> {
|
294
|
-
|
295
|
-
signTx: (p: {
|
296
|
-
tx: T;
|
297
|
-
signer: TurboDataItemSigner;
|
298
|
-
}) => Promise<T>;
|
295
|
+
createSignedTx: (p: TokenCreateTxParams) => Promise<T>;
|
299
296
|
submitTx: (p: {
|
300
297
|
tx: T;
|
301
298
|
}) => Promise<void>;
|