Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge develop branch into master branch #120

Draft
wants to merge 33 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
55d72a8
In to_long(), validate return of Long.fromString()
abitmore Sep 3, 2022
7c05014
Bump cached-path-relative from 1.0.2 to 1.1.0
dependabot[bot] Sep 17, 2023
c255472
Bump @babel/traverse from 7.16.7 to 7.23.2
dependabot[bot] Oct 17, 2023
b91d5d5
Merge pull request #119 from bitshares/dependabot/npm_and_yarn/babel/…
abitmore Oct 17, 2023
4960537
Merge pull request #118 from bitshares/dependabot/npm_and_yarn/cached…
abitmore Oct 17, 2023
0902523
Bump crypto-js from 4.1.1 to 4.2.0
dependabot[bot] Oct 25, 2023
a1aff06
Merge pull request #121 from bitshares/dependabot/npm_and_yarn/crypto…
abitmore Oct 26, 2023
c47494f
Bump browserify-sign from 4.2.1 to 4.2.2
dependabot[bot] Oct 27, 2023
a4e92f1
Merge pull request #122 from bitshares/dependabot/npm_and_yarn/browse…
abitmore Oct 28, 2023
324565f
Update operations.js
grctest Nov 14, 2023
2b26fbb
Merge pull request #100 from bitshares/fix-to-long
sschiessl-bcp Nov 21, 2023
3280588
Merge pull request #125 from BTS-CM/suez
sschiessl-bcp Nov 21, 2023
81dc28e
Add missing extensions field in create_take_profit_order_action
abitmore Nov 24, 2023
e315579
Merge pull request #126 from bitshares/fix-oso-serialization
abitmore Nov 24, 2023
3d2d647
Update ChainTypes.js
grctest Dec 4, 2023
68d6909
Merge pull request #127 from BTS-CM/suez_fix
abitmore Dec 4, 2023
40a860b
Fix limit_order_update_operation serialization
abitmore Dec 6, 2023
9640cea
Merge pull request #128 from bitshares/fix-limit-order-update
abitmore Dec 6, 2023
c6f3eb7
Bump es5-ext from 0.10.53 to 0.10.63
dependabot[bot] Feb 27, 2024
7ae9426
Merge pull request #129 from bitshares/dependabot/npm_and_yarn/es5-ex…
abitmore Feb 27, 2024
81abdd7
Bump @babel/traverse from 7.16.7 to 7.24.1
dependabot[bot] Apr 5, 2024
fdbc36b
Merg dependabot/npm_and_yarn/babel/traverse-7.24.1
abitmore Apr 5, 2024
cc52c57
Merge pull request #131 from bitshares/bump-babel-traverse
abitmore Apr 5, 2024
7e07584
Bump braces from 3.0.2 to 3.0.3
dependabot[bot] Jun 18, 2024
9bcab29
Merge pull request #133 from bitshares/dependabot/npm_and_yarn/braces…
abitmore Jun 18, 2024
ad22f52
Bump ws from 8.4.0 to 8.17.1
dependabot[bot] Jun 18, 2024
74c1ca2
Merge pull request #134 from bitshares/dependabot/npm_and_yarn/ws-8.17.1
abitmore Jun 18, 2024
c0809c9
Bump webpack from 5.88.2 to 5.94.0
dependabot[bot] Aug 30, 2024
1a27da6
Merge pull request #135 from bitshares/dependabot/npm_and_yarn/webpac…
abitmore Aug 31, 2024
8b20851
Bump elliptic from 6.5.4 to 6.5.7
dependabot[bot] Aug 31, 2024
94f9887
Merge pull request #136 from bitshares/dependabot/npm_and_yarn/ellipt…
abitmore Aug 31, 2024
4d2f75e
Bump elliptic from 6.5.7 to 6.6.0
dependabot[bot] Oct 31, 2024
7739950
Merge pull request #139 from bitshares/dependabot/npm_and_yarn/ellipt…
abitmore Oct 31, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion lib/chain/src/ChainTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,10 @@ ChainTypes.operations = {
credit_offer_update: 71,
credit_offer_accept: 72,
credit_deal_repay: 73,
credit_deal_expired: 74 // VIRTUAL
credit_deal_expired: 74, // VIRTUAL
liquidity_pool_update: 75,
credit_deal_update: 76,
limit_order_update: 77
};

ChainTypes.ticket_type = {
Expand Down
12 changes: 11 additions & 1 deletion lib/serializer/src/SerializerValidation.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,20 @@ var _my = {
}

this.no_overflow64(value, field_name, unsigned);
// BigInteger#isBigInteger https://github.com/cryptocoinjs/bigi/issues/20
// (code copied from no_overflow64)
if (value.t !== undefined && value.s !== undefined) {
value = value.toString();
}
if (typeof value === "number") {
value = "" + value;
}
return Long.fromString(value, unsigned);
value = value.trim();
var long_value = Long.fromString(value, unsigned);
if (long_value.toString() !== value) {
throw new Error(`Unable to safely convert ${field_name} ${value} to long`);
}
return long_value;
},

to_string(value, field_name = "") {
Expand Down
78 changes: 75 additions & 3 deletions lib/serializer/src/operations.js
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,25 @@ export const credit_deal_expired_operation_fee_parameters = new Serializer(
{}
);

export const liquidity_pool_update_operation_fee_parameters = new Serializer(
"liquidity_pool_update_operation_fee_parameters",
{
fee: uint64,
}
);

export const credit_deal_update_operation_fee_parameters = new Serializer(
"credit_deal_update_operation_fee_parameters",
{
fee: uint64,
}
);

export const limit_order_update_operation_fee_parameters = new Serializer(
"limit_order_update_operation_fee_parameters",
{ fee: uint64 }
);


var fee_parameters = static_variant([
transfer_operation_fee_parameters,
Expand Down Expand Up @@ -548,7 +567,10 @@ var fee_parameters = static_variant([
credit_offer_update_operation_fee_parameters,
credit_offer_accept_operation_fee_parameters,
credit_deal_repay_operation_fee_parameters,
credit_deal_expired_operation_fee_parameters
credit_deal_expired_operation_fee_parameters,
liquidity_pool_update_operation_fee_parameters,
credit_deal_update_operation_fee_parameters,
limit_order_update_operation_fee_parameters,
]);

export const fee_schedule = new Serializer("fee_schedule", {
Expand Down Expand Up @@ -618,14 +640,30 @@ export const transfer = new Serializer("transfer", {
extensions: set(future_extensions)
});

export const create_take_profit_order_action = new Serializer("create_take_profit_order_action", {
fee_asset_id: protocol_id_type("asset"),
spread_percent: uint16,
size_percent: uint16,
expiration_seconds: uint32,
repeat: bool,
extensions: set(future_extensions)
});

var limit_order_auto_action = static_variant([create_take_profit_order_action]);

export const limit_order_create = new Serializer("limit_order_create", {
fee: asset,
seller: protocol_id_type("account"),
amount_to_sell: asset,
min_to_receive: asset,
expiration: time_point_sec,
fill_or_kill: bool,
extensions: set(future_extensions)
extensions: extension([
{
name: "on_fill",
type: array(limit_order_auto_action),
},
]),
});

export const limit_order_cancel = new Serializer("limit_order_cancel", {
Expand Down Expand Up @@ -1553,6 +1591,37 @@ export const credit_deal_expired = new Serializer("credit_deal_expired", {
fee_rate: uint32
});

// Op 75: liquidity_pool_update_operation
export const liquidity_pool_update = new Serializer("liquidity_pool_update", {
fee: asset,
account: protocol_id_type("account"),
pool: protocol_id_type("liquidity_pool"),
taker_fee_percent: optional(uint16),
withdrawal_fee_percent: optional(uint16),
extensions: set(future_extensions),
});

// Op 76: credit_deal_update_operation
export const credit_deal_update = new Serializer("credit_deal_update", {
fee: asset,
account: protocol_id_type("account"),
deal_id: protocol_id_type("credit_deal"),
auto_repay: uint8,
extensions: set(future_extensions),
});

// Op 77: limit_order_update_operation
export const limit_order_update = new Serializer("limit_order_update", {
fee: asset,
seller: protocol_id_type("account"),
order: protocol_id_type("limit_order"),
new_price: optional(price),
delta_amount_to_sell: optional(asset),
new_expiration: optional(time_point_sec),
on_fill: optional(array(limit_order_auto_action)),
extensions: set(future_extensions)
});

operation.st_operations = [
transfer,
limit_order_create,
Expand Down Expand Up @@ -1628,7 +1697,10 @@ operation.st_operations = [
credit_offer_update,
credit_offer_accept,
credit_deal_repay,
credit_deal_expired
credit_deal_expired,
liquidity_pool_update,
credit_deal_update,
limit_order_update,
];

export const transaction = new Serializer("transaction", {
Expand Down
Loading
Loading