@xelis/sdk 0.9.2 → 0.9.4
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/dist/types/daemon/rpc.d.ts +2 -2
- package/dist/types/daemon/types.d.ts +5 -1
- package/dist/types/daemon/websocket.d.ts +2 -2
- package/package.json +5 -2
- package/create_esm_pkg.js +0 -13
- package/jest.config.js +0 -6
- package/test_dist/index_cjs.js +0 -22
- package/test_dist/index_esm.js +0 -12
- package/tsconfig.cjs.json +0 -7
- package/tsconfig.esm.json +0 -7
- package/tsconfig.json +0 -17
- package/tsconfig.types.json +0 -8
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Block, TopoHeightRangeParams, GetInfoResult, HeightRangeParams, GetBalanceResult, P2PStatusResult, GetBalanceParams, GetBalanceAtTopoHeightParams, GetAccountsParams, GetBlockAtTopoHeightParams, GetBlockByHashParams, GetBlocksAtHeightParams, GetTopBlockParams, GetNonceResult, GetNonceParams, GetAccountHistoryParams, AccounHistory, DevFee, DiskSize, HasBalanceParams, HasBalanceResult, AssetData, IsTxExecutedInBlockParams, GetAssetParams, GetPeersResult, GetBlockTemplateResult, VersionedBalance, VersionedNonce, GetNonceAtTopoheightParams, HasNonceParams, HasNonceResult, TransactionResponse, IsAccountRegisteredParams, GetMempoolCacheResult, GetDifficultyResult, ValidateAddressParams, ExtractKeyFromAddressParams, SubmitBlockParams, CreateMinerWorkParams, CreateMinerWorkResult } from './types';
|
|
1
|
+
import { Block, TopoHeightRangeParams, GetInfoResult, HeightRangeParams, GetBalanceResult, P2PStatusResult, GetBalanceParams, GetBalanceAtTopoHeightParams, GetAccountsParams, GetBlockAtTopoHeightParams, GetBlockByHashParams, GetBlocksAtHeightParams, GetTopBlockParams, GetNonceResult, GetNonceParams, GetAccountHistoryParams, AccounHistory, DevFee, DiskSize, HasBalanceParams, HasBalanceResult, AssetData, IsTxExecutedInBlockParams, GetAssetParams, GetPeersResult, GetBlockTemplateResult, VersionedBalance, VersionedNonce, GetNonceAtTopoheightParams, HasNonceParams, HasNonceResult, TransactionResponse, IsAccountRegisteredParams, GetMempoolCacheResult, GetDifficultyResult, ValidateAddressParams, ExtractKeyFromAddressParams, SubmitBlockParams, CreateMinerWorkParams, CreateMinerWorkResult, ValidateAddressResult } from './types';
|
|
2
2
|
import { RPC as BaseRPC } from '../lib/rpc';
|
|
3
3
|
export declare class RPC extends BaseRPC {
|
|
4
4
|
getVersion(): Promise<import("../lib/types").RPCResponse<string>>;
|
|
@@ -43,7 +43,7 @@ export declare class RPC extends BaseRPC {
|
|
|
43
43
|
isAccountRegistered(params: IsAccountRegisteredParams): Promise<import("../lib/types").RPCResponse<boolean>>;
|
|
44
44
|
getMempoolCache(address: String): Promise<import("../lib/types").RPCResponse<GetMempoolCacheResult>>;
|
|
45
45
|
getDifficulty(): Promise<import("../lib/types").RPCResponse<GetDifficultyResult>>;
|
|
46
|
-
validateAddress(params: ValidateAddressParams): Promise<import("../lib/types").RPCResponse<
|
|
46
|
+
validateAddress(params: ValidateAddressParams): Promise<import("../lib/types").RPCResponse<ValidateAddressResult>>;
|
|
47
47
|
extractKeyFromAddress(params: ExtractKeyFromAddressParams): Promise<import("../lib/types").RPCResponse<string | number[]>>;
|
|
48
48
|
createMinerWork(params: CreateMinerWorkParams): Promise<import("../lib/types").RPCResponse<CreateMinerWorkResult>>;
|
|
49
49
|
}
|
|
@@ -315,9 +315,13 @@ export interface ValidateAddressParams {
|
|
|
315
315
|
address: string;
|
|
316
316
|
allow_integrated: boolean;
|
|
317
317
|
}
|
|
318
|
+
export interface ValidateAddressResult {
|
|
319
|
+
is_integrated: boolean;
|
|
320
|
+
is_valid: boolean;
|
|
321
|
+
}
|
|
318
322
|
export interface ExtractKeyFromAddressParams {
|
|
319
323
|
address: string;
|
|
320
|
-
|
|
324
|
+
as_hex: boolean;
|
|
321
325
|
}
|
|
322
326
|
export interface SubmitBlockParams {
|
|
323
327
|
block_template: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { MessageEvent } from 'ws';
|
|
2
|
-
import { Block, GetInfoResult, GetPeersResult, RPCEventResult, TopoHeightRangeParams, P2PStatusResult, GetBalanceAtTopoHeightParams, GetBalanceResult, HeightRangeParams, BlockOrdered, GetBalanceParams, GetAccountsParams, GetBlockAtTopoHeightParams, GetBlockByHashParams, GetBlocksAtHeightParams, GetTopBlockParams, GetNonceParams, GetNonceResult, GetAccountHistoryParams, AccounHistory, Peer, PeerPeerListUpdated, PeerPeerDisconnected, DevFee, DiskSize, AssetWithData, AssetData, GetAssetParams, HasBalanceParams, HasBalanceResult, IsTxExecutedInBlockParams, BlockOrphaned, VersionedBalance, StableHeightChanged, HasNonceResult, HasNonceParams, TransactionResponse, IsAccountRegisteredParams, GetMempoolCacheResult, GetDifficultyResult, ValidateAddressParams, ExtractKeyFromAddressParams, SubmitBlockParams, CreateMinerWorkParams, CreateMinerWorkResult } from './types';
|
|
2
|
+
import { Block, GetInfoResult, GetPeersResult, RPCEventResult, TopoHeightRangeParams, P2PStatusResult, GetBalanceAtTopoHeightParams, GetBalanceResult, HeightRangeParams, BlockOrdered, GetBalanceParams, GetAccountsParams, GetBlockAtTopoHeightParams, GetBlockByHashParams, GetBlocksAtHeightParams, GetTopBlockParams, GetNonceParams, GetNonceResult, GetAccountHistoryParams, AccounHistory, Peer, PeerPeerListUpdated, PeerPeerDisconnected, DevFee, DiskSize, AssetWithData, AssetData, GetAssetParams, HasBalanceParams, HasBalanceResult, IsTxExecutedInBlockParams, BlockOrphaned, VersionedBalance, StableHeightChanged, HasNonceResult, HasNonceParams, TransactionResponse, IsAccountRegisteredParams, GetMempoolCacheResult, GetDifficultyResult, ValidateAddressParams, ExtractKeyFromAddressParams, SubmitBlockParams, CreateMinerWorkParams, CreateMinerWorkResult, ValidateAddressResult } from './types';
|
|
3
3
|
import { WS as BaseWS } from '../lib/websocket';
|
|
4
4
|
export declare class DaemonMethods {
|
|
5
5
|
ws: BaseWS;
|
|
@@ -61,7 +61,7 @@ export declare class DaemonMethods {
|
|
|
61
61
|
isAccountRegistered(params: IsAccountRegisteredParams): Promise<boolean>;
|
|
62
62
|
getMempoolCacheResult(address: string): Promise<GetMempoolCacheResult>;
|
|
63
63
|
getDifficulty(): Promise<GetDifficultyResult>;
|
|
64
|
-
validateAddress(params: ValidateAddressParams): Promise<
|
|
64
|
+
validateAddress(params: ValidateAddressParams): Promise<ValidateAddressResult>;
|
|
65
65
|
extractKeyFromAddress(params: ExtractKeyFromAddressParams): Promise<string | number[]>;
|
|
66
66
|
createMinerWork(params: CreateMinerWorkParams): Promise<CreateMinerWorkResult>;
|
|
67
67
|
}
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.9.
|
|
2
|
+
"version": "0.9.4",
|
|
3
3
|
"name": "@xelis/sdk",
|
|
4
4
|
"description": "Xelis software development kit for JS",
|
|
5
5
|
"exports": {
|
|
@@ -10,6 +10,9 @@
|
|
|
10
10
|
"default": "./dist/esm/*.js"
|
|
11
11
|
}
|
|
12
12
|
},
|
|
13
|
+
"files": [
|
|
14
|
+
"dist"
|
|
15
|
+
],
|
|
13
16
|
"repository": {
|
|
14
17
|
"type": "git",
|
|
15
18
|
"url": "git+https://github.com/xelis-project/xelis-js-sdk"
|
|
@@ -40,4 +43,4 @@
|
|
|
40
43
|
"react": "^18.2.0",
|
|
41
44
|
"ws": "^8.12.1"
|
|
42
45
|
}
|
|
43
|
-
}
|
|
46
|
+
}
|
package/create_esm_pkg.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
const fs = require('fs')
|
|
2
|
-
|
|
3
|
-
// We need to create a package.json for explicitly setting the ESM folder has modern EcmaScript modules.
|
|
4
|
-
|
|
5
|
-
const main = () => {
|
|
6
|
-
const data = JSON.stringify({
|
|
7
|
-
"type": "module"
|
|
8
|
-
})
|
|
9
|
-
|
|
10
|
-
fs.writeFileSync('./dist/esm/package.json', data)
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
main()
|
package/jest.config.js
DELETED
package/test_dist/index_cjs.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
const { RPC: DaemonRPC } = require('../dist/cjs/daemon/rpc')
|
|
2
|
-
const { WS: DaemonWS } = require('../dist/cjs/daemon/websocket')
|
|
3
|
-
const { WS: WalletWS } = require('../dist/cjs/wallet/websocket')
|
|
4
|
-
const { TESTNET_NODE_RPC, TESTNET_NODE_WS, LOCAL_NODE_WS } = require('../dist/cjs/config')
|
|
5
|
-
|
|
6
|
-
const main = async () => {
|
|
7
|
-
const daemonRPC = new DaemonRPC(TESTNET_NODE_RPC)
|
|
8
|
-
const res1 = await daemonRPC.getInfo()
|
|
9
|
-
console.log(res1)
|
|
10
|
-
|
|
11
|
-
const daemonWS = new DaemonWS()
|
|
12
|
-
await daemonWS.connect(TESTNET_NODE_WS)
|
|
13
|
-
const res2 = await daemonWS.methods.getInfo()
|
|
14
|
-
console.log(res2)
|
|
15
|
-
|
|
16
|
-
const walletWS = new WalletWS(`test`, `test`)
|
|
17
|
-
await walletWS.connect(LOCAL_NODE_WS)
|
|
18
|
-
const res3 = await walletWS.methods.getVersion()
|
|
19
|
-
console.log(res3)
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
main()
|
package/test_dist/index_esm.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { RPC as DaemonRPC } from '../dist/esm/daemon/rpc.js'
|
|
2
|
-
import { TESTNET_NODE_RPC } from '../dist/esm/config.js'
|
|
3
|
-
|
|
4
|
-
// need to add "type": "module" in package.json to test
|
|
5
|
-
|
|
6
|
-
const main = async () => {
|
|
7
|
-
const daemon = new DaemonRPC(TESTNET_NODE_RPC)
|
|
8
|
-
const res = await daemon.getInfo()
|
|
9
|
-
console.log(res)
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
main()
|
package/tsconfig.cjs.json
DELETED
package/tsconfig.esm.json
DELETED
package/tsconfig.json
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"jsx": "react",
|
|
4
|
-
"moduleResolution": "node",
|
|
5
|
-
"outDir": "./dist",
|
|
6
|
-
"strict": true,
|
|
7
|
-
"esModuleInterop": true,
|
|
8
|
-
"skipLibCheck": true,
|
|
9
|
-
},
|
|
10
|
-
"include": [
|
|
11
|
-
"./src/**/*"
|
|
12
|
-
],
|
|
13
|
-
"exclude": [
|
|
14
|
-
"node_modules",
|
|
15
|
-
"**/*.spec.ts"
|
|
16
|
-
]
|
|
17
|
-
}
|