@bosonprotocol/core-sdk 1.33.0 → 1.33.1-alpha.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/dist/cjs/funds/handler.d.ts +2 -2
- package/dist/cjs/funds/handler.js +3 -3
- package/dist/cjs/funds/interface.d.ts +1 -1
- package/dist/cjs/funds/interface.js +2 -2
- package/dist/cjs/funds/mixin.d.ts +4 -4
- package/dist/cjs/funds/mixin.js +6 -6
- package/dist/esm/funds/handler.d.ts +2 -2
- package/dist/esm/funds/handler.js +3 -3
- package/dist/esm/funds/interface.d.ts +1 -1
- package/dist/esm/funds/interface.js +2 -2
- package/dist/esm/funds/mixin.d.ts +4 -4
- package/dist/esm/funds/mixin.js +6 -6
- package/package.json +2 -2
- package/src/funds/handler.ts +5 -5
- package/src/funds/interface.ts +2 -2
- package/src/funds/mixin.ts +6 -6
|
@@ -8,14 +8,14 @@ export declare function depositFunds(args: {
|
|
|
8
8
|
web3Lib: Web3LibAdapter;
|
|
9
9
|
}): Promise<TransactionResponse>;
|
|
10
10
|
export declare function withdrawFunds(args: {
|
|
11
|
-
|
|
11
|
+
entityId: BigNumberish;
|
|
12
12
|
tokensToWithdraw: Array<string>;
|
|
13
13
|
amountsToWithdraw: Array<BigNumberish>;
|
|
14
14
|
contractAddress: string;
|
|
15
15
|
web3Lib: Web3LibAdapter;
|
|
16
16
|
}): Promise<TransactionResponse>;
|
|
17
17
|
export declare function withdrawAllAvailableFunds(args: {
|
|
18
|
-
|
|
18
|
+
entityId: BigNumberish;
|
|
19
19
|
subgraphUrl: string;
|
|
20
20
|
contractAddress: string;
|
|
21
21
|
web3Lib: Web3LibAdapter;
|
|
@@ -33,7 +33,7 @@ function withdrawFunds(args) {
|
|
|
33
33
|
return __awaiter(this, void 0, void 0, function* () {
|
|
34
34
|
return args.web3Lib.sendTransaction({
|
|
35
35
|
to: args.contractAddress,
|
|
36
|
-
data: (0, interface_1.encodeWithdrawFunds)(args.
|
|
36
|
+
data: (0, interface_1.encodeWithdrawFunds)(args.entityId, args.tokensToWithdraw, args.amountsToWithdraw)
|
|
37
37
|
});
|
|
38
38
|
});
|
|
39
39
|
}
|
|
@@ -42,7 +42,7 @@ function withdrawAllAvailableFunds(args) {
|
|
|
42
42
|
return __awaiter(this, void 0, void 0, function* () {
|
|
43
43
|
const funds = yield (0, subgraph_1.getFunds)(args.subgraphUrl, {
|
|
44
44
|
fundsFilter: {
|
|
45
|
-
accountId: args.
|
|
45
|
+
accountId: args.entityId.toString()
|
|
46
46
|
}
|
|
47
47
|
});
|
|
48
48
|
const { tokensToWithdraw, amountsToWithdraw } = funds
|
|
@@ -57,7 +57,7 @@ function withdrawAllAvailableFunds(args) {
|
|
|
57
57
|
});
|
|
58
58
|
return args.web3Lib.sendTransaction({
|
|
59
59
|
to: args.contractAddress,
|
|
60
|
-
data: (0, interface_1.encodeWithdrawFunds)(args.
|
|
60
|
+
data: (0, interface_1.encodeWithdrawFunds)(args.entityId, tokensToWithdraw, amountsToWithdraw)
|
|
61
61
|
});
|
|
62
62
|
});
|
|
63
63
|
}
|
|
@@ -2,5 +2,5 @@ import { Interface } from "@ethersproject/abi";
|
|
|
2
2
|
import { BigNumberish } from "@ethersproject/bignumber";
|
|
3
3
|
export declare const bosonFundsHandlerIface: Interface;
|
|
4
4
|
export declare function encodeDepositFunds(sellerId: BigNumberish, tokenAddress: string, amount: BigNumberish): string;
|
|
5
|
-
export declare function encodeWithdrawFunds(
|
|
5
|
+
export declare function encodeWithdrawFunds(entityId: BigNumberish, tokensToWithdraw: Array<string>, amountsToWithdraw: Array<BigNumberish>): string;
|
|
6
6
|
//# sourceMappingURL=interface.d.ts.map
|
|
@@ -12,9 +12,9 @@ function encodeDepositFunds(sellerId, tokenAddress, amount) {
|
|
|
12
12
|
]);
|
|
13
13
|
}
|
|
14
14
|
exports.encodeDepositFunds = encodeDepositFunds;
|
|
15
|
-
function encodeWithdrawFunds(
|
|
15
|
+
function encodeWithdrawFunds(entityId, tokensToWithdraw, amountsToWithdraw) {
|
|
16
16
|
return exports.bosonFundsHandlerIface.encodeFunctionData("withdrawFunds", [
|
|
17
|
-
|
|
17
|
+
entityId,
|
|
18
18
|
tokensToWithdraw,
|
|
19
19
|
amountsToWithdraw
|
|
20
20
|
]);
|
|
@@ -26,17 +26,17 @@ export declare class FundsMixin extends BaseCoreSDK {
|
|
|
26
26
|
getFunds(queryVars?: subgraph.GetFundsQueryVariables): Promise<subgraph.FundsEntityFieldsFragment[]>;
|
|
27
27
|
/**
|
|
28
28
|
* Withdraw selected funds by calling the `FundsHandlerFacet` contract.
|
|
29
|
-
* @param
|
|
29
|
+
* @param entityId - ID of seller/buyer/agent account to withdraw funds for.
|
|
30
30
|
* @param tokensToWithdraw - Addresses of funds tokens to withdraw.
|
|
31
31
|
* @param amountsToWithdraw - Amounts of funds token to withdraw.
|
|
32
32
|
* @returns Transaction response.
|
|
33
33
|
*/
|
|
34
|
-
withdrawFunds(
|
|
34
|
+
withdrawFunds(entityId: BigNumberish, tokensToWithdraw: Array<string>, amountsToWithdraw: Array<BigNumberish>): Promise<TransactionResponse>;
|
|
35
35
|
/**
|
|
36
36
|
* Withdraw all available funds by calling the `FundsHandlerFacet` contract.
|
|
37
|
-
* @param
|
|
37
|
+
* @param entityId - ID of seller/buyer/agent account to withdraw funds for.
|
|
38
38
|
* @returns Transaction response.
|
|
39
39
|
*/
|
|
40
|
-
withdrawAllAvailableFunds(
|
|
40
|
+
withdrawAllAvailableFunds(entityId: BigNumberish): Promise<TransactionResponse>;
|
|
41
41
|
}
|
|
42
42
|
//# sourceMappingURL=mixin.d.ts.map
|
package/dist/cjs/funds/mixin.js
CHANGED
|
@@ -59,15 +59,15 @@ class FundsMixin extends base_core_sdk_1.BaseCoreSDK {
|
|
|
59
59
|
}
|
|
60
60
|
/**
|
|
61
61
|
* Withdraw selected funds by calling the `FundsHandlerFacet` contract.
|
|
62
|
-
* @param
|
|
62
|
+
* @param entityId - ID of seller/buyer/agent account to withdraw funds for.
|
|
63
63
|
* @param tokensToWithdraw - Addresses of funds tokens to withdraw.
|
|
64
64
|
* @param amountsToWithdraw - Amounts of funds token to withdraw.
|
|
65
65
|
* @returns Transaction response.
|
|
66
66
|
*/
|
|
67
|
-
withdrawFunds(
|
|
67
|
+
withdrawFunds(entityId, tokensToWithdraw, amountsToWithdraw) {
|
|
68
68
|
return __awaiter(this, void 0, void 0, function* () {
|
|
69
69
|
return (0, handler_1.withdrawFunds)({
|
|
70
|
-
|
|
70
|
+
entityId,
|
|
71
71
|
tokensToWithdraw,
|
|
72
72
|
amountsToWithdraw,
|
|
73
73
|
contractAddress: this._protocolDiamond,
|
|
@@ -77,13 +77,13 @@ class FundsMixin extends base_core_sdk_1.BaseCoreSDK {
|
|
|
77
77
|
}
|
|
78
78
|
/**
|
|
79
79
|
* Withdraw all available funds by calling the `FundsHandlerFacet` contract.
|
|
80
|
-
* @param
|
|
80
|
+
* @param entityId - ID of seller/buyer/agent account to withdraw funds for.
|
|
81
81
|
* @returns Transaction response.
|
|
82
82
|
*/
|
|
83
|
-
withdrawAllAvailableFunds(
|
|
83
|
+
withdrawAllAvailableFunds(entityId) {
|
|
84
84
|
return __awaiter(this, void 0, void 0, function* () {
|
|
85
85
|
return (0, handler_1.withdrawAllAvailableFunds)({
|
|
86
|
-
|
|
86
|
+
entityId,
|
|
87
87
|
subgraphUrl: this._subgraphUrl,
|
|
88
88
|
contractAddress: this._protocolDiamond,
|
|
89
89
|
web3Lib: this._web3Lib
|
|
@@ -8,14 +8,14 @@ export declare function depositFunds(args: {
|
|
|
8
8
|
web3Lib: Web3LibAdapter;
|
|
9
9
|
}): Promise<TransactionResponse>;
|
|
10
10
|
export declare function withdrawFunds(args: {
|
|
11
|
-
|
|
11
|
+
entityId: BigNumberish;
|
|
12
12
|
tokensToWithdraw: Array<string>;
|
|
13
13
|
amountsToWithdraw: Array<BigNumberish>;
|
|
14
14
|
contractAddress: string;
|
|
15
15
|
web3Lib: Web3LibAdapter;
|
|
16
16
|
}): Promise<TransactionResponse>;
|
|
17
17
|
export declare function withdrawAllAvailableFunds(args: {
|
|
18
|
-
|
|
18
|
+
entityId: BigNumberish;
|
|
19
19
|
subgraphUrl: string;
|
|
20
20
|
contractAddress: string;
|
|
21
21
|
web3Lib: Web3LibAdapter;
|
|
@@ -17,13 +17,13 @@ export async function depositFunds(args) {
|
|
|
17
17
|
export async function withdrawFunds(args) {
|
|
18
18
|
return args.web3Lib.sendTransaction({
|
|
19
19
|
to: args.contractAddress,
|
|
20
|
-
data: encodeWithdrawFunds(args.
|
|
20
|
+
data: encodeWithdrawFunds(args.entityId, args.tokensToWithdraw, args.amountsToWithdraw)
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
export async function withdrawAllAvailableFunds(args) {
|
|
24
24
|
const funds = await getFunds(args.subgraphUrl, {
|
|
25
25
|
fundsFilter: {
|
|
26
|
-
accountId: args.
|
|
26
|
+
accountId: args.entityId.toString()
|
|
27
27
|
}
|
|
28
28
|
});
|
|
29
29
|
const { tokensToWithdraw, amountsToWithdraw } = funds
|
|
@@ -38,7 +38,7 @@ export async function withdrawAllAvailableFunds(args) {
|
|
|
38
38
|
});
|
|
39
39
|
return args.web3Lib.sendTransaction({
|
|
40
40
|
to: args.contractAddress,
|
|
41
|
-
data: encodeWithdrawFunds(args.
|
|
41
|
+
data: encodeWithdrawFunds(args.entityId, tokensToWithdraw, amountsToWithdraw)
|
|
42
42
|
});
|
|
43
43
|
}
|
|
44
44
|
//# sourceMappingURL=handler.js.map
|
|
@@ -2,5 +2,5 @@ import { Interface } from "@ethersproject/abi";
|
|
|
2
2
|
import { BigNumberish } from "@ethersproject/bignumber";
|
|
3
3
|
export declare const bosonFundsHandlerIface: Interface;
|
|
4
4
|
export declare function encodeDepositFunds(sellerId: BigNumberish, tokenAddress: string, amount: BigNumberish): string;
|
|
5
|
-
export declare function encodeWithdrawFunds(
|
|
5
|
+
export declare function encodeWithdrawFunds(entityId: BigNumberish, tokensToWithdraw: Array<string>, amountsToWithdraw: Array<BigNumberish>): string;
|
|
6
6
|
//# sourceMappingURL=interface.d.ts.map
|
|
@@ -8,9 +8,9 @@ export function encodeDepositFunds(sellerId, tokenAddress, amount) {
|
|
|
8
8
|
amount
|
|
9
9
|
]);
|
|
10
10
|
}
|
|
11
|
-
export function encodeWithdrawFunds(
|
|
11
|
+
export function encodeWithdrawFunds(entityId, tokensToWithdraw, amountsToWithdraw) {
|
|
12
12
|
return bosonFundsHandlerIface.encodeFunctionData("withdrawFunds", [
|
|
13
|
-
|
|
13
|
+
entityId,
|
|
14
14
|
tokensToWithdraw,
|
|
15
15
|
amountsToWithdraw
|
|
16
16
|
]);
|
|
@@ -26,17 +26,17 @@ export declare class FundsMixin extends BaseCoreSDK {
|
|
|
26
26
|
getFunds(queryVars?: subgraph.GetFundsQueryVariables): Promise<subgraph.FundsEntityFieldsFragment[]>;
|
|
27
27
|
/**
|
|
28
28
|
* Withdraw selected funds by calling the `FundsHandlerFacet` contract.
|
|
29
|
-
* @param
|
|
29
|
+
* @param entityId - ID of seller/buyer/agent account to withdraw funds for.
|
|
30
30
|
* @param tokensToWithdraw - Addresses of funds tokens to withdraw.
|
|
31
31
|
* @param amountsToWithdraw - Amounts of funds token to withdraw.
|
|
32
32
|
* @returns Transaction response.
|
|
33
33
|
*/
|
|
34
|
-
withdrawFunds(
|
|
34
|
+
withdrawFunds(entityId: BigNumberish, tokensToWithdraw: Array<string>, amountsToWithdraw: Array<BigNumberish>): Promise<TransactionResponse>;
|
|
35
35
|
/**
|
|
36
36
|
* Withdraw all available funds by calling the `FundsHandlerFacet` contract.
|
|
37
|
-
* @param
|
|
37
|
+
* @param entityId - ID of seller/buyer/agent account to withdraw funds for.
|
|
38
38
|
* @returns Transaction response.
|
|
39
39
|
*/
|
|
40
|
-
withdrawAllAvailableFunds(
|
|
40
|
+
withdrawAllAvailableFunds(entityId: BigNumberish): Promise<TransactionResponse>;
|
|
41
41
|
}
|
|
42
42
|
//# sourceMappingURL=mixin.d.ts.map
|
package/dist/esm/funds/mixin.js
CHANGED
|
@@ -41,14 +41,14 @@ export class FundsMixin extends BaseCoreSDK {
|
|
|
41
41
|
}
|
|
42
42
|
/**
|
|
43
43
|
* Withdraw selected funds by calling the `FundsHandlerFacet` contract.
|
|
44
|
-
* @param
|
|
44
|
+
* @param entityId - ID of seller/buyer/agent account to withdraw funds for.
|
|
45
45
|
* @param tokensToWithdraw - Addresses of funds tokens to withdraw.
|
|
46
46
|
* @param amountsToWithdraw - Amounts of funds token to withdraw.
|
|
47
47
|
* @returns Transaction response.
|
|
48
48
|
*/
|
|
49
|
-
async withdrawFunds(
|
|
49
|
+
async withdrawFunds(entityId, tokensToWithdraw, amountsToWithdraw) {
|
|
50
50
|
return withdrawFunds({
|
|
51
|
-
|
|
51
|
+
entityId,
|
|
52
52
|
tokensToWithdraw,
|
|
53
53
|
amountsToWithdraw,
|
|
54
54
|
contractAddress: this._protocolDiamond,
|
|
@@ -57,12 +57,12 @@ export class FundsMixin extends BaseCoreSDK {
|
|
|
57
57
|
}
|
|
58
58
|
/**
|
|
59
59
|
* Withdraw all available funds by calling the `FundsHandlerFacet` contract.
|
|
60
|
-
* @param
|
|
60
|
+
* @param entityId - ID of seller/buyer/agent account to withdraw funds for.
|
|
61
61
|
* @returns Transaction response.
|
|
62
62
|
*/
|
|
63
|
-
async withdrawAllAvailableFunds(
|
|
63
|
+
async withdrawAllAvailableFunds(entityId) {
|
|
64
64
|
return withdrawAllAvailableFunds({
|
|
65
|
-
|
|
65
|
+
entityId,
|
|
66
66
|
subgraphUrl: this._subgraphUrl,
|
|
67
67
|
contractAddress: this._protocolDiamond,
|
|
68
68
|
web3Lib: this._web3Lib
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bosonprotocol/core-sdk",
|
|
3
|
-
"version": "1.33.0",
|
|
3
|
+
"version": "1.33.1-alpha.0",
|
|
4
4
|
"description": "Facilitates interaction with the contracts and subgraphs of the Boson Protocol",
|
|
5
5
|
"main": "./dist/cjs/index.js",
|
|
6
6
|
"module": "./dist/esm/index.js",
|
|
@@ -59,5 +59,5 @@
|
|
|
59
59
|
"overrides": {
|
|
60
60
|
"typescript": "^5.1.6"
|
|
61
61
|
},
|
|
62
|
-
"gitHead": "
|
|
62
|
+
"gitHead": "899b97642e8e2185591e12a28a5f591cedd358b8"
|
|
63
63
|
}
|
package/src/funds/handler.ts
CHANGED
|
@@ -32,7 +32,7 @@ export async function depositFunds(args: {
|
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
export async function withdrawFunds(args: {
|
|
35
|
-
|
|
35
|
+
entityId: BigNumberish;
|
|
36
36
|
tokensToWithdraw: Array<string>;
|
|
37
37
|
amountsToWithdraw: Array<BigNumberish>;
|
|
38
38
|
contractAddress: string;
|
|
@@ -41,7 +41,7 @@ export async function withdrawFunds(args: {
|
|
|
41
41
|
return args.web3Lib.sendTransaction({
|
|
42
42
|
to: args.contractAddress,
|
|
43
43
|
data: encodeWithdrawFunds(
|
|
44
|
-
args.
|
|
44
|
+
args.entityId,
|
|
45
45
|
args.tokensToWithdraw,
|
|
46
46
|
args.amountsToWithdraw
|
|
47
47
|
)
|
|
@@ -49,14 +49,14 @@ export async function withdrawFunds(args: {
|
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
export async function withdrawAllAvailableFunds(args: {
|
|
52
|
-
|
|
52
|
+
entityId: BigNumberish;
|
|
53
53
|
subgraphUrl: string;
|
|
54
54
|
contractAddress: string;
|
|
55
55
|
web3Lib: Web3LibAdapter;
|
|
56
56
|
}): Promise<TransactionResponse> {
|
|
57
57
|
const funds = await getFunds(args.subgraphUrl, {
|
|
58
58
|
fundsFilter: {
|
|
59
|
-
accountId: args.
|
|
59
|
+
accountId: args.entityId.toString()
|
|
60
60
|
}
|
|
61
61
|
});
|
|
62
62
|
|
|
@@ -77,7 +77,7 @@ export async function withdrawAllAvailableFunds(args: {
|
|
|
77
77
|
return args.web3Lib.sendTransaction({
|
|
78
78
|
to: args.contractAddress,
|
|
79
79
|
data: encodeWithdrawFunds(
|
|
80
|
-
args.
|
|
80
|
+
args.entityId,
|
|
81
81
|
tokensToWithdraw,
|
|
82
82
|
amountsToWithdraw
|
|
83
83
|
)
|
package/src/funds/interface.ts
CHANGED
|
@@ -17,12 +17,12 @@ export function encodeDepositFunds(
|
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
export function encodeWithdrawFunds(
|
|
20
|
-
|
|
20
|
+
entityId: BigNumberish,
|
|
21
21
|
tokensToWithdraw: Array<string>,
|
|
22
22
|
amountsToWithdraw: Array<BigNumberish>
|
|
23
23
|
) {
|
|
24
24
|
return bosonFundsHandlerIface.encodeFunctionData("withdrawFunds", [
|
|
25
|
-
|
|
25
|
+
entityId,
|
|
26
26
|
tokensToWithdraw,
|
|
27
27
|
amountsToWithdraw
|
|
28
28
|
]);
|
package/src/funds/mixin.ts
CHANGED
|
@@ -62,18 +62,18 @@ export class FundsMixin extends BaseCoreSDK {
|
|
|
62
62
|
|
|
63
63
|
/**
|
|
64
64
|
* Withdraw selected funds by calling the `FundsHandlerFacet` contract.
|
|
65
|
-
* @param
|
|
65
|
+
* @param entityId - ID of seller/buyer/agent account to withdraw funds for.
|
|
66
66
|
* @param tokensToWithdraw - Addresses of funds tokens to withdraw.
|
|
67
67
|
* @param amountsToWithdraw - Amounts of funds token to withdraw.
|
|
68
68
|
* @returns Transaction response.
|
|
69
69
|
*/
|
|
70
70
|
public async withdrawFunds(
|
|
71
|
-
|
|
71
|
+
entityId: BigNumberish,
|
|
72
72
|
tokensToWithdraw: Array<string>,
|
|
73
73
|
amountsToWithdraw: Array<BigNumberish>
|
|
74
74
|
): Promise<TransactionResponse> {
|
|
75
75
|
return withdrawFunds({
|
|
76
|
-
|
|
76
|
+
entityId,
|
|
77
77
|
tokensToWithdraw,
|
|
78
78
|
amountsToWithdraw,
|
|
79
79
|
contractAddress: this._protocolDiamond,
|
|
@@ -83,14 +83,14 @@ export class FundsMixin extends BaseCoreSDK {
|
|
|
83
83
|
|
|
84
84
|
/**
|
|
85
85
|
* Withdraw all available funds by calling the `FundsHandlerFacet` contract.
|
|
86
|
-
* @param
|
|
86
|
+
* @param entityId - ID of seller/buyer/agent account to withdraw funds for.
|
|
87
87
|
* @returns Transaction response.
|
|
88
88
|
*/
|
|
89
89
|
public async withdrawAllAvailableFunds(
|
|
90
|
-
|
|
90
|
+
entityId: BigNumberish
|
|
91
91
|
): Promise<TransactionResponse> {
|
|
92
92
|
return withdrawAllAvailableFunds({
|
|
93
|
-
|
|
93
|
+
entityId,
|
|
94
94
|
subgraphUrl: this._subgraphUrl,
|
|
95
95
|
contractAddress: this._protocolDiamond,
|
|
96
96
|
web3Lib: this._web3Lib
|