@dynamic-labs/waas-ton 4.51.0 → 4.51.2
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/CHANGELOG.md +6610 -0
- package/LICENSE +21 -0
- package/_virtual/_tslib.cjs +36 -0
- package/_virtual/_tslib.js +32 -0
- package/package.cjs +8 -0
- package/package.js +4 -0
- package/package.json +4 -4
- package/src/index.cjs +28 -0
- package/src/index.d.ts +7 -0
- package/src/index.js +10 -0
- package/src/types/index.d.ts +37 -0
- package/src/utils/getWalletSeqno/getWalletSeqno.cjs +22 -0
- package/src/utils/getWalletSeqno/getWalletSeqno.d.ts +9 -0
- package/src/utils/getWalletSeqno/getWalletSeqno.js +18 -0
- package/src/utils/index.d.ts +2 -0
- package/src/utils/logger/logger.cjs +13 -0
- package/src/utils/logger/logger.d.ts +3 -0
- package/src/utils/logger/logger.js +5 -0
- package/.eslintrc.json +0 -33
- package/jest.config.ts +0 -29
- package/project.json +0 -47
- package/rollup.config.cjs +0 -7
- package/src/index.ts +0 -18
- package/src/types/index.ts +0 -39
- package/src/utils/index.ts +0 -1
- package/src/utils/logger/logger.spec.ts +0 -7
- package/src/utils/logger/logger.ts +0 -6
- package/test/mocks/browserWalletClientMock.ts +0 -38
- package/test/setupAfterEnv.config.ts +0 -7
- package/tsconfig.json +0 -23
- package/tsconfig.lib.json +0 -10
- package/tsconfig.spec.json +0 -14
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2022 Dynamic Labs, Inc.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
|
+
|
|
6
|
+
/******************************************************************************
|
|
7
|
+
Copyright (c) Microsoft Corporation.
|
|
8
|
+
|
|
9
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
10
|
+
purpose with or without fee is hereby granted.
|
|
11
|
+
|
|
12
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
13
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
14
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
15
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
16
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
17
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
18
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
19
|
+
***************************************************************************** */
|
|
20
|
+
|
|
21
|
+
function __awaiter(thisArg, _arguments, P, generator) {
|
|
22
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
23
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
24
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
25
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
26
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
27
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
32
|
+
var e = new Error(message);
|
|
33
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
exports.__awaiter = __awaiter;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
/******************************************************************************
|
|
3
|
+
Copyright (c) Microsoft Corporation.
|
|
4
|
+
|
|
5
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
6
|
+
purpose with or without fee is hereby granted.
|
|
7
|
+
|
|
8
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
9
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
10
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
11
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
12
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
13
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
14
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
15
|
+
***************************************************************************** */
|
|
16
|
+
|
|
17
|
+
function __awaiter(thisArg, _arguments, P, generator) {
|
|
18
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
19
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
20
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
21
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
22
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
23
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
28
|
+
var e = new Error(message);
|
|
29
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export { __awaiter };
|
package/package.cjs
ADDED
package/package.js
ADDED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs/waas-ton",
|
|
3
|
-
"version": "4.51.
|
|
3
|
+
"version": "4.51.2",
|
|
4
4
|
"description": "A React SDK for implementing wallet web3 authentication and authorization to your website.",
|
|
5
5
|
"author": "Dynamic Labs, Inc.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -18,11 +18,11 @@
|
|
|
18
18
|
},
|
|
19
19
|
"homepage": "https://www.dynamic.xyz/",
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@dynamic-labs/assert-package-version": "4.51.
|
|
22
|
-
"@dynamic-labs/logger": "4.51.
|
|
21
|
+
"@dynamic-labs/assert-package-version": "4.51.2",
|
|
22
|
+
"@dynamic-labs/logger": "4.51.2",
|
|
23
23
|
"@dynamic-labs/sdk-api-core": "0.0.843",
|
|
24
24
|
"@ton/core": "0.62.0",
|
|
25
25
|
"@ton/crypto": "3.3.0",
|
|
26
26
|
"@ton/ton": "16.0.0"
|
|
27
27
|
}
|
|
28
|
-
}
|
|
28
|
+
}
|
package/src/index.cjs
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
|
+
|
|
6
|
+
var core = require('@ton/core');
|
|
7
|
+
var ton = require('@ton/ton');
|
|
8
|
+
var crypto = require('@ton/crypto');
|
|
9
|
+
var assertPackageVersion = require('@dynamic-labs/assert-package-version');
|
|
10
|
+
var _package = require('../package.cjs');
|
|
11
|
+
var getWalletSeqno = require('./utils/getWalletSeqno/getWalletSeqno.cjs');
|
|
12
|
+
require('./utils/logger/logger.cjs');
|
|
13
|
+
|
|
14
|
+
assertPackageVersion.assertPackageVersion('@dynamic-labs/waas-ton', _package.version);
|
|
15
|
+
|
|
16
|
+
Object.defineProperty(exports, 'toNano', {
|
|
17
|
+
enumerable: true,
|
|
18
|
+
get: function () { return core.toNano; }
|
|
19
|
+
});
|
|
20
|
+
Object.defineProperty(exports, 'TonClient', {
|
|
21
|
+
enumerable: true,
|
|
22
|
+
get: function () { return ton.TonClient; }
|
|
23
|
+
});
|
|
24
|
+
Object.defineProperty(exports, 'mnemonicToWalletKey', {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function () { return crypto.mnemonicToWalletKey; }
|
|
27
|
+
});
|
|
28
|
+
exports.getWalletSeqno = getWalletSeqno.getWalletSeqno;
|
package/src/index.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { toNano } from '@ton/core';
|
|
2
|
+
import { TonClient } from '@ton/ton';
|
|
3
|
+
import { mnemonicToWalletKey } from '@ton/crypto';
|
|
4
|
+
import { SignMessageContext } from '@dynamic-labs/sdk-api-core';
|
|
5
|
+
export { TonClient, toNano, mnemonicToWalletKey, type SignMessageContext };
|
|
6
|
+
export { getWalletSeqno } from './utils';
|
|
7
|
+
export type { TonConnectDomain, TonConnectProof, TonTransactionData, } from './types';
|
package/src/index.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
export { toNano } from '@ton/core';
|
|
3
|
+
export { TonClient } from '@ton/ton';
|
|
4
|
+
export { mnemonicToWalletKey } from '@ton/crypto';
|
|
5
|
+
import { assertPackageVersion } from '@dynamic-labs/assert-package-version';
|
|
6
|
+
import { version } from '../package.js';
|
|
7
|
+
export { getWalletSeqno } from './utils/getWalletSeqno/getWalletSeqno.js';
|
|
8
|
+
import './utils/logger/logger.js';
|
|
9
|
+
|
|
10
|
+
assertPackageVersion('@dynamic-labs/waas-ton', version);
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Domain information for TON Connect protocol
|
|
3
|
+
*/
|
|
4
|
+
export interface TonConnectDomain {
|
|
5
|
+
/** Length of domain value in bytes */
|
|
6
|
+
lengthBytes: number;
|
|
7
|
+
/** Domain value (e.g., example.com) */
|
|
8
|
+
value: string;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Complete TON Connect proof object
|
|
12
|
+
*/
|
|
13
|
+
export interface TonConnectProof {
|
|
14
|
+
/** Wallet address string */
|
|
15
|
+
address: string;
|
|
16
|
+
/** Domain information */
|
|
17
|
+
domain: TonConnectDomain;
|
|
18
|
+
/** Unix timestamp in seconds */
|
|
19
|
+
timestamp: number;
|
|
20
|
+
/** Payload string */
|
|
21
|
+
payload: string;
|
|
22
|
+
/** Signature as base64 string */
|
|
23
|
+
signature: string;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Generic transaction data that can be used for any TON transaction type
|
|
27
|
+
*/
|
|
28
|
+
export interface TonTransactionData {
|
|
29
|
+
/** Sender wallet address */
|
|
30
|
+
address: string;
|
|
31
|
+
/** Current wallet seqno */
|
|
32
|
+
seqno: number;
|
|
33
|
+
/** Base64-encoded message body (the transaction to be signed) */
|
|
34
|
+
messageBody: string;
|
|
35
|
+
/** Transaction timeout in seconds */
|
|
36
|
+
timeout: number;
|
|
37
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
|
+
|
|
6
|
+
var _tslib = require('../../../_virtual/_tslib.cjs');
|
|
7
|
+
var ton = require('@ton/ton');
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Fetches the current seqno using TonClient
|
|
11
|
+
*
|
|
12
|
+
* @param walletAddress - Wallet address string
|
|
13
|
+
* @param client - TonClient instance
|
|
14
|
+
* @returns Current seqno
|
|
15
|
+
*/
|
|
16
|
+
const getWalletSeqno = (walletAddress, client) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
17
|
+
const address = ton.Address.parse(walletAddress);
|
|
18
|
+
const result = yield client.runMethod(address, 'seqno');
|
|
19
|
+
return result.stack.readNumber();
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
exports.getWalletSeqno = getWalletSeqno;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { TonClient } from '@ton/ton';
|
|
2
|
+
/**
|
|
3
|
+
* Fetches the current seqno using TonClient
|
|
4
|
+
*
|
|
5
|
+
* @param walletAddress - Wallet address string
|
|
6
|
+
* @param client - TonClient instance
|
|
7
|
+
* @returns Current seqno
|
|
8
|
+
*/
|
|
9
|
+
export declare const getWalletSeqno: (walletAddress: string, client: TonClient) => Promise<number>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
import { __awaiter } from '../../../_virtual/_tslib.js';
|
|
3
|
+
import { Address } from '@ton/ton';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Fetches the current seqno using TonClient
|
|
7
|
+
*
|
|
8
|
+
* @param walletAddress - Wallet address string
|
|
9
|
+
* @param client - TonClient instance
|
|
10
|
+
* @returns Current seqno
|
|
11
|
+
*/
|
|
12
|
+
const getWalletSeqno = (walletAddress, client) => __awaiter(void 0, void 0, void 0, function* () {
|
|
13
|
+
const address = Address.parse(walletAddress);
|
|
14
|
+
const result = yield client.runMethod(address, 'seqno');
|
|
15
|
+
return result.stack.readNumber();
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
export { getWalletSeqno };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
|
+
|
|
6
|
+
var logger = require('@dynamic-labs/logger');
|
|
7
|
+
|
|
8
|
+
new logger.Logger('@dynamic-labs/waas-ton');
|
|
9
|
+
|
|
10
|
+
Object.defineProperty(exports, 'Logger', {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function () { return logger.Logger; }
|
|
13
|
+
});
|
package/.eslintrc.json
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": ["../../.eslintrc.json"],
|
|
3
|
-
"ignorePatterns": ["!**/*"],
|
|
4
|
-
"overrides": [
|
|
5
|
-
{
|
|
6
|
-
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
|
|
7
|
-
"rules": {
|
|
8
|
-
"import/no-namespace": "off",
|
|
9
|
-
"no-restricted-syntax": [
|
|
10
|
-
"error",
|
|
11
|
-
{
|
|
12
|
-
"selector": "MemberExpression[object.name='window'][property.name='location']",
|
|
13
|
-
"message": "Use PlatformService from @dynamic-labs/utils package instead of directly accessing window.location."
|
|
14
|
-
}
|
|
15
|
-
]
|
|
16
|
-
}
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
"files": ["*.spec.ts", "*.spec.tsx", "*.spec.js", "*.spec.jsx"],
|
|
20
|
-
"rules": {
|
|
21
|
-
"no-restricted-syntax": "off"
|
|
22
|
-
}
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
"files": ["*.ts", "*.tsx"],
|
|
26
|
-
"rules": {}
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
"files": ["*.js", "*.jsx"],
|
|
30
|
-
"rules": {}
|
|
31
|
-
}
|
|
32
|
-
]
|
|
33
|
-
}
|
package/jest.config.ts
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
/* eslint-disable */
|
|
2
|
-
/* eslint-disable sort-keys */
|
|
3
|
-
|
|
4
|
-
const esModules = [
|
|
5
|
-
'@dynamic-labs-wallet/forward-mpc-client',
|
|
6
|
-
'@dynamic-labs-wallet/forward-mpc-shared',
|
|
7
|
-
'@noble/.*',
|
|
8
|
-
'@evervault/wasm-attestation-bindings',
|
|
9
|
-
].join('|');
|
|
10
|
-
|
|
11
|
-
export default {
|
|
12
|
-
displayName: 'waas-ton',
|
|
13
|
-
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'],
|
|
14
|
-
preset: '../../jest.preset.js',
|
|
15
|
-
resetMocks: false,
|
|
16
|
-
transform: {
|
|
17
|
-
'^(?!.*\\.(js|jsx|ts|tsx|css|json)$)': '@nrwl/react/plugins/jest',
|
|
18
|
-
'node_modules/@onflow': 'ts-jest',
|
|
19
|
-
'^.+\\.[tj]sx?$': ['babel-jest', { presets: ['@nrwl/react/babel'] }],
|
|
20
|
-
},
|
|
21
|
-
transformIgnorePatterns: [`node_modules/(?!(${esModules}|@simplewebauthn)/)`],
|
|
22
|
-
moduleNameMapper: {
|
|
23
|
-
'@dynamic-labs-wallet/browser-wallet-client':
|
|
24
|
-
'<rootDir>/test/mocks/browserWalletClientMock.ts',
|
|
25
|
-
},
|
|
26
|
-
maxWorkers: '2',
|
|
27
|
-
workerIdleMemoryLimit: '1.25gb',
|
|
28
|
-
setupFilesAfterEnv: ['./test/setupAfterEnv.config.ts'],
|
|
29
|
-
};
|
package/project.json
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "waas-ton",
|
|
3
|
-
"$schema": "../../node_modules/nx/schemas/project-schema.json",
|
|
4
|
-
"sourceRoot": "packages/waas-ton/src",
|
|
5
|
-
"projectType": "library",
|
|
6
|
-
"targets": {
|
|
7
|
-
"post-build": {},
|
|
8
|
-
"build": {
|
|
9
|
-
"executor": "@nrwl/rollup:rollup",
|
|
10
|
-
"outputs": ["{options.outputPath}"],
|
|
11
|
-
"dependsOn": ["^build"],
|
|
12
|
-
"options": {
|
|
13
|
-
"outputPath": "dist/packages/waas-ton",
|
|
14
|
-
"entryFile": "packages/waas-ton/src/index.ts",
|
|
15
|
-
"tsConfig": "packages/waas-ton/tsconfig.lib.json",
|
|
16
|
-
"project": "packages/waas-ton/package.json",
|
|
17
|
-
"rollupConfig": "packages/waas-ton/rollup.config.cjs",
|
|
18
|
-
"buildableProjectDepsInPackageJsonType": "dependencies",
|
|
19
|
-
"updateBuildableProjectDepsInPackageJson": true,
|
|
20
|
-
"compiler": "tsc",
|
|
21
|
-
"format": ["esm", "cjs"]
|
|
22
|
-
}
|
|
23
|
-
},
|
|
24
|
-
"lint": {
|
|
25
|
-
"executor": "@nrwl/linter:eslint",
|
|
26
|
-
"outputs": ["{options.outputFile}"],
|
|
27
|
-
"options": {
|
|
28
|
-
"lintFilePatterns": ["packages/waas-ton/**/*.ts"]
|
|
29
|
-
}
|
|
30
|
-
},
|
|
31
|
-
"test": {
|
|
32
|
-
"executor": "@nrwl/jest:jest",
|
|
33
|
-
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
|
|
34
|
-
"options": {
|
|
35
|
-
"jestConfig": "packages/waas-ton/jest.config.ts",
|
|
36
|
-
"passWithNoTests": true
|
|
37
|
-
},
|
|
38
|
-
"configurations": {
|
|
39
|
-
"ci": {
|
|
40
|
-
"ci": true,
|
|
41
|
-
"codeCoverage": true
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
},
|
|
46
|
-
"tags": []
|
|
47
|
-
}
|
package/rollup.config.cjs
DELETED
package/src/index.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { toNano } from '@ton/core';
|
|
2
|
-
import { TonClient } from '@ton/ton';
|
|
3
|
-
import { mnemonicToWalletKey } from '@ton/crypto';
|
|
4
|
-
|
|
5
|
-
import { SignMessageContext } from '@dynamic-labs/sdk-api-core';
|
|
6
|
-
import { assertPackageVersion } from '@dynamic-labs/assert-package-version';
|
|
7
|
-
|
|
8
|
-
import { version as packageVersion } from '../package.json';
|
|
9
|
-
|
|
10
|
-
assertPackageVersion('@dynamic-labs/waas-ton', packageVersion);
|
|
11
|
-
|
|
12
|
-
export { TonClient, toNano, mnemonicToWalletKey, type SignMessageContext };
|
|
13
|
-
|
|
14
|
-
export type {
|
|
15
|
-
TonConnectDomain,
|
|
16
|
-
TonConnectProof,
|
|
17
|
-
TonTransactionData,
|
|
18
|
-
} from './types';
|
package/src/types/index.ts
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Domain information for TON Connect protocol
|
|
3
|
-
*/
|
|
4
|
-
export interface TonConnectDomain {
|
|
5
|
-
/** Length of domain value in bytes */
|
|
6
|
-
lengthBytes: number;
|
|
7
|
-
/** Domain value (e.g., example.com) */
|
|
8
|
-
value: string;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Complete TON Connect proof object
|
|
13
|
-
*/
|
|
14
|
-
export interface TonConnectProof {
|
|
15
|
-
/** Wallet address string */
|
|
16
|
-
address: string;
|
|
17
|
-
/** Domain information */
|
|
18
|
-
domain: TonConnectDomain;
|
|
19
|
-
/** Unix timestamp in seconds */
|
|
20
|
-
timestamp: number;
|
|
21
|
-
/** Payload string */
|
|
22
|
-
payload: string;
|
|
23
|
-
/** Signature as base64 string */
|
|
24
|
-
signature: string;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* Generic transaction data that can be used for any TON transaction type
|
|
29
|
-
*/
|
|
30
|
-
export interface TonTransactionData {
|
|
31
|
-
/** Sender wallet address */
|
|
32
|
-
address: string;
|
|
33
|
-
/** Current wallet seqno */
|
|
34
|
-
seqno: number;
|
|
35
|
-
/** Base64-encoded message body (the transaction to be signed) */
|
|
36
|
-
messageBody: string;
|
|
37
|
-
/** Transaction timeout in seconds */
|
|
38
|
-
timeout: number;
|
|
39
|
-
}
|
package/src/utils/index.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './logger/logger';
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
export const createWalletAccountMock = jest.fn();
|
|
2
|
-
export const exportClientKeysharesMock = jest.fn();
|
|
3
|
-
export const getWalletMock = jest.fn();
|
|
4
|
-
export const signMessageMock = jest.fn();
|
|
5
|
-
export const exportPrivateKeyMock = jest.fn();
|
|
6
|
-
export const importPrivateKeyMock = jest.fn();
|
|
7
|
-
export const backupKeySharesToGoogleDriveMock = jest.fn();
|
|
8
|
-
export const delegateKeySharesMock = jest.fn();
|
|
9
|
-
export const refreshWalletAccountSharesMock = jest.fn();
|
|
10
|
-
export const updatePasswordMock = jest.fn();
|
|
11
|
-
export const signRawMessageMock = jest.fn();
|
|
12
|
-
|
|
13
|
-
export const AuthMode = {
|
|
14
|
-
HEADER: 'header',
|
|
15
|
-
COOKIE: 'cookie',
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
export class DynamicWalletClient {
|
|
19
|
-
initialize = jest.fn();
|
|
20
|
-
createWalletAccount = createWalletAccountMock;
|
|
21
|
-
exportClientKeyshares = exportClientKeysharesMock;
|
|
22
|
-
getWallet = getWalletMock;
|
|
23
|
-
signMessage = signMessageMock;
|
|
24
|
-
exportPrivateKey = exportPrivateKeyMock;
|
|
25
|
-
importPrivateKey = importPrivateKeyMock;
|
|
26
|
-
backupKeySharesToGoogleDrive = backupKeySharesToGoogleDriveMock;
|
|
27
|
-
delegateKeyShares = delegateKeySharesMock;
|
|
28
|
-
refreshWalletAccountShares = refreshWalletAccountSharesMock;
|
|
29
|
-
updatePassword = updatePasswordMock;
|
|
30
|
-
signRawMessage = signRawMessageMock;
|
|
31
|
-
chainName = 'TON';
|
|
32
|
-
cleanup = jest.fn();
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
export const ThresholdSignatureScheme = {
|
|
36
|
-
TWO_OF_TWO: 'TWO_OF_TWO',
|
|
37
|
-
TWO_OF_THREE: 'TWO_OF_THREE',
|
|
38
|
-
};
|
package/tsconfig.json
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "../../tsconfig.base.json",
|
|
3
|
-
"compilerOptions": {
|
|
4
|
-
"esModuleInterop": false,
|
|
5
|
-
"allowSyntheticDefaultImports": true,
|
|
6
|
-
"forceConsistentCasingInFileNames": true,
|
|
7
|
-
"strict": true,
|
|
8
|
-
"noImplicitOverride": true,
|
|
9
|
-
"noPropertyAccessFromIndexSignature": false,
|
|
10
|
-
"noImplicitReturns": true,
|
|
11
|
-
"noFallthroughCasesInSwitch": true
|
|
12
|
-
},
|
|
13
|
-
"files": [],
|
|
14
|
-
"include": [],
|
|
15
|
-
"references": [
|
|
16
|
-
{
|
|
17
|
-
"path": "./tsconfig.lib.json"
|
|
18
|
-
},
|
|
19
|
-
{
|
|
20
|
-
"path": "./tsconfig.spec.json"
|
|
21
|
-
}
|
|
22
|
-
]
|
|
23
|
-
}
|
package/tsconfig.lib.json
DELETED
package/tsconfig.spec.json
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "./tsconfig.json",
|
|
3
|
-
"compilerOptions": {
|
|
4
|
-
"outDir": "../../dist/out-tsc",
|
|
5
|
-
"module": "commonjs",
|
|
6
|
-
"types": ["jest", "node"]
|
|
7
|
-
},
|
|
8
|
-
"include": [
|
|
9
|
-
"jest.config.ts",
|
|
10
|
-
"src/**/*.test.ts",
|
|
11
|
-
"src/**/*.spec.ts",
|
|
12
|
-
"src/**/*.d.ts"
|
|
13
|
-
]
|
|
14
|
-
}
|