@ethersphere/bee-js 1.2.1 → 3.0.0
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 +135 -2
- package/README.md +3 -1
- package/dist/index.browser.min.js +1 -1
- package/dist/index.browser.min.js.LICENSE.txt +51 -0
- package/dist/index.browser.min.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.LICENSE.txt +42 -0
- package/dist/index.min.js.map +1 -1
- package/dist/src/bee-debug.d.ts +75 -38
- package/dist/src/bee.d.ts +88 -82
- package/dist/src/chunk/soc.d.ts +6 -6
- package/dist/src/feed/index.d.ts +7 -7
- package/dist/src/feed/json.d.ts +2 -2
- package/dist/src/modules/bytes.d.ts +8 -11
- package/dist/src/modules/bzz.d.ts +9 -14
- package/dist/src/modules/chunk.d.ts +7 -11
- package/dist/src/modules/debug/balance.d.ts +9 -9
- package/dist/src/modules/debug/chequebook.d.ts +17 -18
- package/dist/src/modules/debug/chunk.d.ts +5 -5
- package/dist/src/modules/debug/connectivity.d.ts +7 -7
- package/dist/src/modules/debug/settlements.d.ts +5 -5
- package/dist/src/modules/debug/stamps.d.ts +7 -5
- package/dist/src/modules/debug/states.d.ts +5 -5
- package/dist/src/modules/debug/status.d.ts +5 -4
- package/dist/src/modules/debug/tag.d.ts +3 -3
- package/dist/src/modules/debug/transactions.d.ts +9 -9
- package/dist/src/modules/feed.d.ts +5 -5
- package/dist/src/modules/pinning.d.ts +9 -9
- package/dist/src/modules/pss.d.ts +4 -3
- package/dist/src/modules/soc.d.ts +3 -3
- package/dist/src/modules/status.d.ts +3 -2
- package/dist/src/modules/stewardship.d.ts +4 -4
- package/dist/src/modules/tag.d.ts +6 -6
- package/dist/src/types/debug.d.ts +4 -2
- package/dist/src/types/index.d.ts +71 -19
- package/dist/src/utils/bytes.d.ts +1 -1
- package/dist/src/utils/data.browser.d.ts +3 -1
- package/dist/src/utils/data.d.ts +7 -4
- package/dist/src/utils/expose.d.ts +6 -9
- package/dist/src/utils/headers.d.ts +3 -3
- package/dist/src/utils/http.d.ts +25 -0
- package/dist/src/utils/merge.d.ts +8 -0
- package/dist/src/utils/pss.d.ts +9 -0
- package/dist/src/utils/stream.d.ts +37 -0
- package/dist/src/utils/type.d.ts +19 -9
- package/package.json +15 -8
- package/.babelrc.js +0 -33
- package/.depcheckrc.json +0 -27
- package/.editorconfig +0 -6
- package/.eslintignore +0 -1
- package/.eslintrc.js +0 -108
- package/.gitattributes +0 -1
- package/.github/config.yaml +0 -23
- package/.github/workflows/check.yaml +0 -57
- package/.github/workflows/publish_npmjs.yaml +0 -20
- package/.github/workflows/release_github.yaml +0 -20
- package/.github/workflows/tests.yaml +0 -128
- package/.huskyrc +0 -5
- package/.prettierrc +0 -13
- package/.vscode/launch.json +0 -49
- package/.vscode/settings.json +0 -39
- package/CODEOWNERS +0 -1
- package/CODE_OF_CONDUCT.md +0 -76
- package/commitlint.config.js +0 -3
- package/dist/src/modules/stamps.d.ts +0 -4
- package/dist/src/utils/hooks.d.ts +0 -31
- package/dist/src/utils/safe-axios.d.ts +0 -8
- package/jest-puppeteer.config.js +0 -5
- package/jest.config.ts +0 -170
- package/src/bee-debug.ts +0 -440
- package/src/bee.ts +0 -941
- package/src/chunk/bmt.ts +0 -55
- package/src/chunk/cac.ts +0 -79
- package/src/chunk/serialize.ts +0 -16
- package/src/chunk/signer.ts +0 -141
- package/src/chunk/soc.ts +0 -190
- package/src/chunk/span.ts +0 -33
- package/src/feed/index.ts +0 -221
- package/src/feed/json.ts +0 -32
- package/src/feed/topic.ts +0 -23
- package/src/feed/type.ts +0 -12
- package/src/index.ts +0 -24
- package/src/modules/bytes.ts +0 -75
- package/src/modules/bzz.ts +0 -184
- package/src/modules/chunk.ts +0 -75
- package/src/modules/debug/balance.ts +0 -63
- package/src/modules/debug/chequebook.ts +0 -174
- package/src/modules/debug/chunk.ts +0 -39
- package/src/modules/debug/connectivity.ts +0 -61
- package/src/modules/debug/settlements.ts +0 -33
- package/src/modules/debug/stamps.ts +0 -69
- package/src/modules/debug/states.ts +0 -35
- package/src/modules/debug/status.ts +0 -34
- package/src/modules/debug/tag.ts +0 -19
- package/src/modules/debug/transactions.ts +0 -79
- package/src/modules/feed.ts +0 -92
- package/src/modules/pinning.ts +0 -74
- package/src/modules/pss.ts +0 -48
- package/src/modules/soc.ts +0 -41
- package/src/modules/stamps.ts +0 -59
- package/src/modules/status.ts +0 -13
- package/src/modules/stewardship.ts +0 -21
- package/src/modules/tag.ts +0 -83
- package/src/types/axios/index.d.ts +0 -18
- package/src/types/debug.ts +0 -204
- package/src/types/index.ts +0 -497
- package/src/types/tar-js.d.ts +0 -1
- package/src/types/webpack-bundle-analyzer/index.d.ts +0 -13
- package/src/utils/bytes.ts +0 -144
- package/src/utils/collection.ts +0 -151
- package/src/utils/data.browser.ts +0 -24
- package/src/utils/data.ts +0 -35
- package/src/utils/error.ts +0 -23
- package/src/utils/eth.ts +0 -229
- package/src/utils/expose.ts +0 -10
- package/src/utils/file.ts +0 -40
- package/src/utils/hash.ts +0 -16
- package/src/utils/headers.ts +0 -63
- package/src/utils/hex.ts +0 -186
- package/src/utils/hooks.ts +0 -89
- package/src/utils/safe-axios.ts +0 -98
- package/src/utils/tar.ts +0 -30
- package/src/utils/type.ts +0 -302
- package/src/utils/uint64.ts +0 -31
- package/src/utils/url.ts +0 -52
- package/test/bee.sh +0 -187
- package/test/data/1.txt +0 -1
- package/test/data/2.txt +0 -0
- package/test/data/empty +0 -0
- package/test/data/sub/3.txt +0 -1
- package/test/data/sub//303/251 +0 -0
- package/test/data/sub//360/237/230/216 +0 -0
- package/test/integration/bee-class.browser.spec.ts +0 -215
- package/test/integration/bee-class.spec.ts +0 -595
- package/test/integration/bee-debug-class.spec.ts +0 -85
- package/test/integration/chunk/bmt.spec.ts +0 -33
- package/test/integration/chunk/cac.spec.ts +0 -27
- package/test/integration/chunk/soc.spec.ts +0 -38
- package/test/integration/feed/index.spec.ts +0 -84
- package/test/integration/modules/bytes.spec.ts +0 -23
- package/test/integration/modules/bzz.spec.ts +0 -270
- package/test/integration/modules/chunk.spec.ts +0 -29
- package/test/integration/modules/debug/balance.spec.ts +0 -70
- package/test/integration/modules/debug/chequebook.spec.ts +0 -64
- package/test/integration/modules/debug/connectivity.spec.ts +0 -69
- package/test/integration/modules/debug/settlements.spec.ts +0 -34
- package/test/integration/modules/debug/states.spec.ts +0 -34
- package/test/integration/modules/debug/status.spec.ts +0 -65
- package/test/integration/modules/debug/tag.spec.ts +0 -27
- package/test/integration/modules/feed.spec.ts +0 -61
- package/test/integration/modules/pinning.spec.ts +0 -155
- package/test/integration/modules/pss.spec.ts +0 -92
- package/test/integration/modules/status.spec.ts +0 -10
- package/test/integration/modules/stewardship.spec.ts +0 -32
- package/test/integration/modules/tag.spec.ts +0 -51
- package/test/test-type-sequencer.js +0 -36
- package/test/testpage/testpage.html +0 -20
- package/test/unit/assertions.ts +0 -376
- package/test/unit/bee-class.spec.ts +0 -685
- package/test/unit/bee-debug-class.spec.ts +0 -365
- package/test/unit/chunk/bmt.spec.ts +0 -16
- package/test/unit/chunk/cac.spec.ts +0 -29
- package/test/unit/chunk/serialize.spec.ts +0 -24
- package/test/unit/chunk/signer.spec.ts +0 -140
- package/test/unit/chunk/soc.spec.ts +0 -25
- package/test/unit/chunk/span.spec.ts +0 -38
- package/test/unit/feed/json.spec.ts +0 -73
- package/test/unit/nock.ts +0 -134
- package/test/unit/utils/bytes.spec.ts +0 -32
- package/test/unit/utils/collection.spec.ts +0 -22
- package/test/unit/utils/eth.spec.ts +0 -224
- package/test/unit/utils/hex.spec.ts +0 -115
- package/test/unit/utils/hooks.spec.ts +0 -179
- package/test/unit/utils/safe-axios.spec.ts +0 -20
- package/test/unit/utils/type.spec.ts +0 -32
- package/test/unit/utils/uint64.spec.ts +0 -102
- package/test/utils.ts +0 -292
- package/tsconfig.json +0 -18
- package/tsconfig.test.json +0 -11
- package/typedoc.json +0 -7
- package/webpack.config.ts +0 -141
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import { PeerBalance, BalanceResponse } from '../../types';
|
|
1
|
+
import type { PeerBalance, BalanceResponse, Ky } from '../../types';
|
|
2
2
|
/**
|
|
3
3
|
* Get the balances with all known peers including prepaid services
|
|
4
4
|
*
|
|
5
|
-
* @param
|
|
5
|
+
* @param ky Ky debug instance
|
|
6
6
|
*/
|
|
7
|
-
export declare function getAllBalances(
|
|
7
|
+
export declare function getAllBalances(ky: Ky): Promise<BalanceResponse>;
|
|
8
8
|
/**
|
|
9
9
|
* Get the balances with a specific peer including prepaid services
|
|
10
10
|
*
|
|
11
|
-
* @param
|
|
11
|
+
* @param ky Ky debug instance
|
|
12
12
|
* @param address Swarm address of peer
|
|
13
13
|
*/
|
|
14
|
-
export declare function getPeerBalance(
|
|
14
|
+
export declare function getPeerBalance(ky: Ky, address: string): Promise<PeerBalance>;
|
|
15
15
|
/**
|
|
16
16
|
* Get the past due consumption balances with all known peers
|
|
17
17
|
*
|
|
18
|
-
* @param
|
|
18
|
+
* @param ky Ky debug instance
|
|
19
19
|
*/
|
|
20
|
-
export declare function getPastDueConsumptionBalances(
|
|
20
|
+
export declare function getPastDueConsumptionBalances(ky: Ky): Promise<BalanceResponse>;
|
|
21
21
|
/**
|
|
22
22
|
* Get the past due consumption balance with a specific peer
|
|
23
23
|
*
|
|
24
|
-
* @param
|
|
24
|
+
* @param ky Ky debug instance
|
|
25
25
|
* @param address Swarm address of peer
|
|
26
26
|
*/
|
|
27
|
-
export declare function getPastDueConsumptionPeerBalance(
|
|
27
|
+
export declare function getPastDueConsumptionPeerBalance(ky: Ky, address: string): Promise<PeerBalance>;
|
|
@@ -1,60 +1,59 @@
|
|
|
1
|
-
import type { ChequebookAddressResponse, ChequebookBalanceResponse, LastCashoutActionResponse, LastChequesForPeerResponse, LastChequesResponse, NumberString, TransactionHash } from '../../types';
|
|
2
|
-
import { CashoutOptions } from '../../types';
|
|
1
|
+
import type { ChequebookAddressResponse, ChequebookBalanceResponse, LastCashoutActionResponse, LastChequesForPeerResponse, LastChequesResponse, NumberString, Ky, CashoutOptions, TransactionHash } from '../../types';
|
|
3
2
|
/**
|
|
4
3
|
* Get the address of the chequebook contract used
|
|
5
4
|
*
|
|
6
|
-
* @param
|
|
5
|
+
* @param ky Ky debug instance
|
|
7
6
|
*/
|
|
8
|
-
export declare function getChequebookAddress(
|
|
7
|
+
export declare function getChequebookAddress(ky: Ky): Promise<ChequebookAddressResponse>;
|
|
9
8
|
/**
|
|
10
9
|
* Get the balance of the chequebook
|
|
11
10
|
*
|
|
12
|
-
* @param
|
|
11
|
+
* @param ky Ky debug instance
|
|
13
12
|
*/
|
|
14
|
-
export declare function getChequebookBalance(
|
|
13
|
+
export declare function getChequebookBalance(ky: Ky): Promise<ChequebookBalanceResponse>;
|
|
15
14
|
/**
|
|
16
15
|
* Get last cashout action for the peer
|
|
17
16
|
*
|
|
18
|
-
* @param
|
|
17
|
+
* @param ky Ky debug instance
|
|
19
18
|
* @param peer Swarm address of peer
|
|
20
19
|
*/
|
|
21
|
-
export declare function getLastCashoutAction(
|
|
20
|
+
export declare function getLastCashoutAction(ky: Ky, peer: string): Promise<LastCashoutActionResponse>;
|
|
22
21
|
/**
|
|
23
22
|
* Cashout the last cheque for the peer
|
|
24
23
|
*
|
|
25
|
-
* @param
|
|
24
|
+
* @param ky Ky debug instance
|
|
26
25
|
* @param peer Swarm address of peer
|
|
27
26
|
* @param options
|
|
28
27
|
*/
|
|
29
|
-
export declare function cashoutLastCheque(
|
|
28
|
+
export declare function cashoutLastCheque(ky: Ky, peer: string, options?: CashoutOptions): Promise<TransactionHash>;
|
|
30
29
|
/**
|
|
31
30
|
* Get last cheques for the peer
|
|
32
31
|
*
|
|
33
|
-
* @param
|
|
32
|
+
* @param ky Ky debug instance
|
|
34
33
|
* @param peer Swarm address of peer
|
|
35
34
|
*/
|
|
36
|
-
export declare function getLastChequesForPeer(
|
|
35
|
+
export declare function getLastChequesForPeer(ky: Ky, peer: string): Promise<LastChequesForPeerResponse>;
|
|
37
36
|
/**
|
|
38
37
|
* Get last cheques for all peers
|
|
39
38
|
*
|
|
40
|
-
* @param
|
|
39
|
+
* @param ky Ky debug instance
|
|
41
40
|
*/
|
|
42
|
-
export declare function getLastCheques(
|
|
41
|
+
export declare function getLastCheques(ky: Ky): Promise<LastChequesResponse>;
|
|
43
42
|
/**
|
|
44
43
|
* Deposit tokens from overlay address into chequebook
|
|
45
44
|
*
|
|
46
|
-
* @param
|
|
45
|
+
* @param ky Ky debug instance
|
|
47
46
|
* @param amount Amount of tokens to deposit
|
|
48
47
|
* @param gasPrice Gas Price in WEI for the transaction call
|
|
49
48
|
* @return string Hash of the transaction
|
|
50
49
|
*/
|
|
51
|
-
export declare function depositTokens(
|
|
50
|
+
export declare function depositTokens(ky: Ky, amount: number | NumberString, gasPrice?: NumberString): Promise<TransactionHash>;
|
|
52
51
|
/**
|
|
53
52
|
* Withdraw tokens from the chequebook to the overlay address
|
|
54
53
|
*
|
|
55
|
-
* @param
|
|
54
|
+
* @param ky Ky debug instance
|
|
56
55
|
* @param amount Amount of tokens to withdraw
|
|
57
56
|
* @param gasPrice Gas Price in WEI for the transaction call
|
|
58
57
|
* @return string Hash of the transaction
|
|
59
58
|
*/
|
|
60
|
-
export declare function withdrawTokens(
|
|
59
|
+
export declare function withdrawTokens(ky: Ky, amount: number | NumberString, gasPrice?: NumberString): Promise<TransactionHash>;
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { BeeGenericResponse } from '../../types';
|
|
1
|
+
import type { BeeGenericResponse, Ky } from '../../types';
|
|
2
2
|
/**
|
|
3
3
|
* Check if chunk at address exists locally
|
|
4
4
|
*
|
|
5
|
-
* @param
|
|
5
|
+
* @param ky Ky debug instance
|
|
6
6
|
* @param address Swarm address of chunk
|
|
7
7
|
*
|
|
8
8
|
* @returns BeeGenericResponse if chunk is found or throws an exception
|
|
9
9
|
*/
|
|
10
|
-
export declare function checkIfChunkExistsLocally(
|
|
10
|
+
export declare function checkIfChunkExistsLocally(ky: Ky, address: string): Promise<BeeGenericResponse>;
|
|
11
11
|
/**
|
|
12
12
|
* Delete a chunk from local storage
|
|
13
13
|
*
|
|
14
|
-
* @param
|
|
14
|
+
* @param ky Ky debug instance
|
|
15
15
|
* @param address Swarm address of chunk
|
|
16
16
|
*
|
|
17
17
|
* @returns BeeGenericResponse if chunk was deleted or throws an exception
|
|
18
18
|
*/
|
|
19
|
-
export declare function deleteChunkFromLocalStorage(
|
|
19
|
+
export declare function deleteChunkFromLocalStorage(ky: Ky, address: string): Promise<BeeGenericResponse>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { NodeAddresses, Peer, PingResponse, RemovePeerResponse, Topology } from '../../types';
|
|
2
|
-
export declare function getNodeAddresses(
|
|
3
|
-
export declare function getPeers(
|
|
4
|
-
export declare function getBlocklist(
|
|
5
|
-
export declare function removePeer(
|
|
6
|
-
export declare function getTopology(
|
|
7
|
-
export declare function pingPeer(
|
|
1
|
+
import type { Ky, NodeAddresses, Peer, PingResponse, RemovePeerResponse, Topology } from '../../types';
|
|
2
|
+
export declare function getNodeAddresses(ky: Ky): Promise<NodeAddresses>;
|
|
3
|
+
export declare function getPeers(ky: Ky): Promise<Peer[]>;
|
|
4
|
+
export declare function getBlocklist(ky: Ky): Promise<Peer[]>;
|
|
5
|
+
export declare function removePeer(ky: Ky, peer: string): Promise<RemovePeerResponse>;
|
|
6
|
+
export declare function getTopology(ky: Ky): Promise<Topology>;
|
|
7
|
+
export declare function pingPeer(ky: Ky, peer: string): Promise<PingResponse>;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { Settlements, AllSettlements } from '../../types';
|
|
1
|
+
import type { Settlements, AllSettlements, Ky } from '../../types';
|
|
2
2
|
/**
|
|
3
3
|
* Get amount of sent and received from settlements with a peer
|
|
4
4
|
*
|
|
5
|
-
* @param
|
|
5
|
+
* @param ky Ky debug instance
|
|
6
6
|
* @param peer Swarm address of peer
|
|
7
7
|
*/
|
|
8
|
-
export declare function getSettlements(
|
|
8
|
+
export declare function getSettlements(ky: Ky, peer: string): Promise<Settlements>;
|
|
9
9
|
/**
|
|
10
10
|
* Get settlements with all known peers and total amount sent or received
|
|
11
11
|
*
|
|
12
|
-
* @param
|
|
12
|
+
* @param ky Ky debug instance
|
|
13
13
|
*/
|
|
14
|
-
export declare function getAllSettlements(
|
|
14
|
+
export declare function getAllSettlements(ky: Ky): Promise<AllSettlements>;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import { BatchId, DebugPostageBatch, NumberString, PostageBatchBuckets, PostageBatchOptions } from '../../types';
|
|
2
|
-
export declare function getAllPostageBatches(
|
|
3
|
-
export declare function getPostageBatch(
|
|
4
|
-
export declare function getPostageBatchBuckets(
|
|
5
|
-
export declare function createPostageBatch(
|
|
1
|
+
import type { BatchId, DebugPostageBatch, Ky, NumberString, PostageBatchBuckets, PostageBatchOptions } from '../../types';
|
|
2
|
+
export declare function getAllPostageBatches(ky: Ky): Promise<DebugPostageBatch[]>;
|
|
3
|
+
export declare function getPostageBatch(ky: Ky, postageBatchId: BatchId): Promise<DebugPostageBatch>;
|
|
4
|
+
export declare function getPostageBatchBuckets(ky: Ky, postageBatchId: BatchId): Promise<PostageBatchBuckets>;
|
|
5
|
+
export declare function createPostageBatch(ky: Ky, amount: NumberString, depth: number, options?: PostageBatchOptions): Promise<BatchId>;
|
|
6
|
+
export declare function topUpBatch(ky: Ky, id: string, amount: NumberString): Promise<BatchId>;
|
|
7
|
+
export declare function diluteBatch(ky: Ky, id: string, depth: number): Promise<BatchId>;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { ChainState, ReserveState } from '../../types';
|
|
1
|
+
import { ChainState, Ky, ReserveState } from '../../types';
|
|
2
2
|
/**
|
|
3
3
|
* Get state of reserve
|
|
4
4
|
*
|
|
5
|
-
* @param
|
|
5
|
+
* @param ky Ky debug instance
|
|
6
6
|
*/
|
|
7
|
-
export declare function getReserveState(
|
|
7
|
+
export declare function getReserveState(ky: Ky): Promise<ReserveState>;
|
|
8
8
|
/**
|
|
9
9
|
* Get state of reserve
|
|
10
10
|
*
|
|
11
|
-
* @param
|
|
11
|
+
* @param ky Ky debug instance
|
|
12
12
|
*/
|
|
13
|
-
export declare function getChainState(
|
|
13
|
+
export declare function getChainState(ky: Ky): Promise<ChainState>;
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
import type { Health } from '../../types/debug';
|
|
2
|
+
import { Ky } from '../../types';
|
|
2
3
|
export declare const SUPPORTED_BEE_VERSION_EXACT: string;
|
|
3
4
|
export declare const SUPPORTED_BEE_VERSION: string;
|
|
4
5
|
/**
|
|
5
6
|
* Get health of node
|
|
6
7
|
*
|
|
7
|
-
* @param
|
|
8
|
+
* @param ky Ky debug instance
|
|
8
9
|
*/
|
|
9
|
-
export declare function getHealth(
|
|
10
|
+
export declare function getHealth(ky: Ky): Promise<Health> | never;
|
|
10
11
|
/**
|
|
11
12
|
* Connnects to a node and checks if it is a supported Bee version by the bee-js
|
|
12
13
|
*
|
|
13
|
-
* @param
|
|
14
|
+
* @param ky Ky debug instance
|
|
14
15
|
*
|
|
15
16
|
* @returns true if the Bee node version is supported
|
|
16
17
|
*/
|
|
17
|
-
export declare function isSupportedVersion(
|
|
18
|
+
export declare function isSupportedVersion(ky: Ky): Promise<boolean> | never;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { ExtendedTag } from '../../types';
|
|
1
|
+
import { ExtendedTag, Ky } from '../../types';
|
|
2
2
|
/**
|
|
3
3
|
* Retrieve tag with extended information from Bee node
|
|
4
4
|
*
|
|
5
|
-
* @param
|
|
5
|
+
* @param ky Ky debug instance
|
|
6
6
|
* @param uid UID of tag to be retrieved
|
|
7
7
|
*/
|
|
8
|
-
export declare function retrieveExtendedTag(
|
|
8
|
+
export declare function retrieveExtendedTag(ky: Ky, uid: number): Promise<ExtendedTag>;
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import { NumberString, TransactionHash, TransactionInfo } from '../../types';
|
|
1
|
+
import { Ky, NumberString, TransactionHash, TransactionInfo } from '../../types';
|
|
2
2
|
/**
|
|
3
3
|
* Get list of all pending transactions
|
|
4
4
|
*
|
|
5
|
-
* @param
|
|
5
|
+
* @param ky Debug Ky instance
|
|
6
6
|
*/
|
|
7
|
-
export declare function getAllTransactions(
|
|
7
|
+
export declare function getAllTransactions(ky: Ky): Promise<TransactionInfo[]>;
|
|
8
8
|
/**
|
|
9
9
|
* Get information for specific pending transactions
|
|
10
10
|
*
|
|
11
|
-
* @param
|
|
11
|
+
* @param ky Debug Ky instance
|
|
12
12
|
* @param transactionHash Hash of the transaction
|
|
13
13
|
*/
|
|
14
|
-
export declare function getTransaction(
|
|
14
|
+
export declare function getTransaction(ky: Ky, transactionHash: TransactionHash): Promise<TransactionInfo>;
|
|
15
15
|
/**
|
|
16
16
|
* Rebroadcast existing transaction
|
|
17
17
|
*
|
|
18
|
-
* @param
|
|
18
|
+
* @param ky Debug Ky instance
|
|
19
19
|
* @param transactionHash Hash of the transaction
|
|
20
20
|
*/
|
|
21
|
-
export declare function rebroadcastTransaction(
|
|
21
|
+
export declare function rebroadcastTransaction(ky: Ky, transactionHash: TransactionHash): Promise<TransactionHash>;
|
|
22
22
|
/**
|
|
23
23
|
* Cancel existing transaction
|
|
24
24
|
*
|
|
25
|
-
* @param
|
|
25
|
+
* @param ky Debug Ky instance
|
|
26
26
|
* @param transactionHash Hash of the transaction
|
|
27
27
|
* @param gasPrice Optional gas price
|
|
28
28
|
*/
|
|
29
|
-
export declare function cancelTransaction(
|
|
29
|
+
export declare function cancelTransaction(ky: Ky, transactionHash: TransactionHash, gasPrice?: NumberString): Promise<TransactionHash>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BatchId, Reference, ReferenceResponse, Topic } from '../types';
|
|
1
|
+
import { BatchId, Ky, Reference, ReferenceResponse, Topic } from '../types';
|
|
2
2
|
import { FeedType } from '../feed/type';
|
|
3
3
|
import { HexEthAddress } from '../utils/eth';
|
|
4
4
|
export interface CreateFeedOptions {
|
|
@@ -23,13 +23,13 @@ export interface FetchFeedUpdateResponse extends ReferenceResponse, FeedUpdateHe
|
|
|
23
23
|
/**
|
|
24
24
|
* Create an initial feed root manifest
|
|
25
25
|
*
|
|
26
|
-
* @param
|
|
26
|
+
* @param ky Ky instance
|
|
27
27
|
* @param owner Owner's ethereum address in hex
|
|
28
28
|
* @param topic Topic in hex
|
|
29
29
|
* @param postageBatchId Postage BatchId to be used to create the Feed Manifest
|
|
30
30
|
* @param options Additional options, like type (default: 'sequence')
|
|
31
31
|
*/
|
|
32
|
-
export declare function createFeedManifest(
|
|
32
|
+
export declare function createFeedManifest(ky: Ky, owner: HexEthAddress, topic: Topic, postageBatchId: BatchId, options?: CreateFeedOptions): Promise<Reference>;
|
|
33
33
|
/**
|
|
34
34
|
* Find and retrieve feed update
|
|
35
35
|
*
|
|
@@ -38,10 +38,10 @@ export declare function createFeedManifest(url: string, owner: HexEthAddress, to
|
|
|
38
38
|
* the reference it contains along with its index and the
|
|
39
39
|
* index of the subsequent update.
|
|
40
40
|
*
|
|
41
|
-
* @param
|
|
41
|
+
* @param ky Ky instance
|
|
42
42
|
* @param owner Owner's ethereum address in hex
|
|
43
43
|
* @param topic Topic in hex
|
|
44
44
|
* @param options Additional options, like index, at, type
|
|
45
45
|
*/
|
|
46
|
-
export declare function fetchFeedUpdate(
|
|
46
|
+
export declare function fetchFeedUpdate(ky: Ky, owner: HexEthAddress, topic: Topic, options?: FeedUpdateOptions): Promise<FetchFeedUpdateResponse>;
|
|
47
47
|
export {};
|
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
import type { Pin, Reference } from '../types';
|
|
1
|
+
import type { Ky, Pin, Reference } from '../types';
|
|
2
2
|
export interface GetAllPinResponse {
|
|
3
3
|
references: Reference[] | null;
|
|
4
4
|
}
|
|
5
5
|
/**
|
|
6
6
|
* Pin data with given reference
|
|
7
7
|
*
|
|
8
|
-
* @param
|
|
8
|
+
* @param ky Ky instance for given Bee class instance
|
|
9
9
|
* @param reference Bee data reference
|
|
10
10
|
*/
|
|
11
|
-
export declare function pin(
|
|
11
|
+
export declare function pin(ky: Ky, reference: Reference): Promise<void>;
|
|
12
12
|
/**
|
|
13
13
|
* Unpin data with given reference
|
|
14
14
|
*
|
|
15
|
-
* @param
|
|
15
|
+
* @param ky Ky instance for given Bee class instance
|
|
16
16
|
* @param reference Bee data reference
|
|
17
17
|
*/
|
|
18
|
-
export declare function unpin(
|
|
18
|
+
export declare function unpin(ky: Ky, reference: Reference): Promise<void>;
|
|
19
19
|
/**
|
|
20
20
|
* Get pin status for specific address.
|
|
21
21
|
*
|
|
22
|
-
* @param
|
|
22
|
+
* @param ky Ky instance
|
|
23
23
|
* @param reference
|
|
24
24
|
* @throws Error if given address is not pinned
|
|
25
25
|
*/
|
|
26
|
-
export declare function getPin(
|
|
26
|
+
export declare function getPin(ky: Ky, reference: Reference): Promise<Pin>;
|
|
27
27
|
/**
|
|
28
28
|
* Get list of all pins
|
|
29
29
|
*
|
|
30
|
-
* @param
|
|
30
|
+
* @param ky Ky instance
|
|
31
31
|
*/
|
|
32
|
-
export declare function getAllPins(
|
|
32
|
+
export declare function getAllPins(ky: Ky): Promise<Reference[]>;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/// <reference types="ws" />
|
|
2
2
|
import WebSocket from 'isomorphic-ws';
|
|
3
|
-
import type { BatchId, PublicKey } from '../types';
|
|
3
|
+
import type { BatchId, Ky, PublicKey } from '../types';
|
|
4
4
|
/**
|
|
5
5
|
* Send to recipient or target with Postal Service for Swarm
|
|
6
6
|
*
|
|
7
|
-
* @param
|
|
7
|
+
* @param ky Ky instance for given Bee class instance
|
|
8
8
|
* @param topic Topic name
|
|
9
9
|
* @param target Target message address prefix
|
|
10
10
|
* @param data
|
|
@@ -12,10 +12,11 @@ import type { BatchId, PublicKey } from '../types';
|
|
|
12
12
|
* @param recipient Recipient public key
|
|
13
13
|
*
|
|
14
14
|
*/
|
|
15
|
-
export declare function send(
|
|
15
|
+
export declare function send(ky: Ky, topic: string, target: string, data: string | Uint8Array, postageBatchId: BatchId, recipient?: PublicKey): Promise<void>;
|
|
16
16
|
/**
|
|
17
17
|
* Subscribe for messages on the given topic
|
|
18
18
|
*
|
|
19
|
+
* @param url Bee node URL
|
|
19
20
|
* @param topic Topic name
|
|
20
21
|
*/
|
|
21
22
|
export declare function subscribe(url: string, topic: string): WebSocket;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { BatchId, Reference, UploadOptions } from '../types';
|
|
1
|
+
import { BatchId, Ky, Reference, UploadOptions } from '../types';
|
|
2
2
|
/**
|
|
3
3
|
* Upload single owner chunk (SOC) to a Bee node
|
|
4
4
|
*
|
|
5
|
-
* @param
|
|
5
|
+
* @param ky Ky instance
|
|
6
6
|
* @param owner Owner's ethereum address in hex
|
|
7
7
|
* @param identifier Arbitrary identifier in hex
|
|
8
8
|
* @param signature Signature in hex
|
|
@@ -10,4 +10,4 @@ import { BatchId, Reference, UploadOptions } from '../types';
|
|
|
10
10
|
* @param postageBatchId Postage BatchId that will be assigned to uploaded data
|
|
11
11
|
* @param options Additional options like tag, encryption, pinning
|
|
12
12
|
*/
|
|
13
|
-
export declare function upload(
|
|
13
|
+
export declare function upload(ky: Ky, owner: string, identifier: string, signature: string, data: Uint8Array, postageBatchId: BatchId, options?: UploadOptions): Promise<Reference>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { Ky } from '../types';
|
|
1
2
|
/**
|
|
2
3
|
* Ping the base bee URL. If connection was not successful throw error
|
|
3
4
|
*
|
|
4
|
-
* @param
|
|
5
|
+
* @param ky Ky instance for given Bee class instance
|
|
5
6
|
*/
|
|
6
|
-
export declare function checkConnection(
|
|
7
|
+
export declare function checkConnection(ky: Ky): Promise<void> | never;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { Reference } from '../types';
|
|
2
|
-
import { AxiosRequestConfig } from 'axios';
|
|
1
|
+
import type { Ky, Reference } from '../types';
|
|
3
2
|
/**
|
|
4
3
|
* Reupload locally pinned data
|
|
5
|
-
* @param
|
|
4
|
+
* @param ky Ky instance
|
|
6
5
|
* @param reference
|
|
7
6
|
* @param options
|
|
8
7
|
* @throws BeeResponseError if not locally pinned or invalid data
|
|
9
8
|
*/
|
|
10
|
-
export declare function reupload(
|
|
9
|
+
export declare function reupload(ky: Ky, reference: Reference): Promise<void>;
|
|
10
|
+
export declare function isRetrievable(ky: Ky, reference: Reference): Promise<boolean>;
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { Reference, Tag } from '../types';
|
|
1
|
+
import { Ky, Reference, Tag } from '../types';
|
|
2
2
|
/**
|
|
3
3
|
* Create new tag on the Bee node
|
|
4
4
|
*
|
|
5
5
|
* @param url Bee tag URL
|
|
6
6
|
*/
|
|
7
|
-
export declare function createTag(
|
|
7
|
+
export declare function createTag(ky: Ky): Promise<Tag>;
|
|
8
8
|
/**
|
|
9
9
|
* Retrieve tag information from Bee node
|
|
10
10
|
*
|
|
11
11
|
* @param url Bee tag URL
|
|
12
12
|
* @param uid UID of tag to be retrieved
|
|
13
13
|
*/
|
|
14
|
-
export declare function retrieveTag(
|
|
14
|
+
export declare function retrieveTag(ky: Ky, uid: number): Promise<Tag>;
|
|
15
15
|
/**
|
|
16
16
|
* Get limited listing of all tags.
|
|
17
17
|
*
|
|
@@ -19,17 +19,17 @@ export declare function retrieveTag(url: string, uid: number): Promise<Tag>;
|
|
|
19
19
|
* @param offset
|
|
20
20
|
* @param limit
|
|
21
21
|
*/
|
|
22
|
-
export declare function getAllTags(
|
|
22
|
+
export declare function getAllTags(ky: Ky, offset?: number, limit?: number): Promise<Tag[]>;
|
|
23
23
|
/**
|
|
24
24
|
* Removes tag from the Bee node.
|
|
25
25
|
* @param url
|
|
26
26
|
* @param uid
|
|
27
27
|
*/
|
|
28
|
-
export declare function deleteTag(
|
|
28
|
+
export declare function deleteTag(ky: Ky, uid: number): Promise<void>;
|
|
29
29
|
/**
|
|
30
30
|
* Updates tag
|
|
31
31
|
* @param url
|
|
32
32
|
* @param uid
|
|
33
33
|
* @param reference
|
|
34
34
|
*/
|
|
35
|
-
export declare function updateTag(
|
|
35
|
+
export declare function updateTag(ky: Ky, uid: number, reference: Reference): Promise<void>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PublicKey, NumberString, Reference, TransactionHash } from './index';
|
|
1
|
+
import { PublicKey, NumberString, Reference, TransactionHash, RequestOptions } from './index';
|
|
2
2
|
import { HexEthAddress } from '../utils/eth';
|
|
3
3
|
/**
|
|
4
4
|
* Object that contains information about progress of upload of data to network.
|
|
@@ -70,7 +70,7 @@ export interface ChequebookBalanceResponse {
|
|
|
70
70
|
totalBalance: NumberString;
|
|
71
71
|
availableBalance: NumberString;
|
|
72
72
|
}
|
|
73
|
-
export interface CashoutOptions {
|
|
73
|
+
export interface CashoutOptions extends RequestOptions {
|
|
74
74
|
/**
|
|
75
75
|
* Gas price for the cashout transaction in WEI
|
|
76
76
|
*/
|
|
@@ -118,6 +118,8 @@ export interface BalanceResponse {
|
|
|
118
118
|
export interface Health {
|
|
119
119
|
status: 'ok';
|
|
120
120
|
version: string;
|
|
121
|
+
apiVersion: string;
|
|
122
|
+
debugApiVersion: string;
|
|
121
123
|
}
|
|
122
124
|
export interface RemovePeerResponse {
|
|
123
125
|
message: string;
|