Skip to content

Commit

Permalink
Merge pull request #27 from golos-blockchain/0.9.64
Browse files Browse the repository at this point in the history
0.9.64
  • Loading branch information
Lex-Ai authored Feb 3, 2024
2 parents 698fedc + d6d91bf commit e612428
Show file tree
Hide file tree
Showing 7 changed files with 68 additions and 22 deletions.
16 changes: 10 additions & 6 deletions golos-lib-js/docs/files/nft.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
В приведенном выше примере коллекция создается аккаунтом-владельцем игры.

```js
const postingKey = '5HwQScueMZdELZpjVBD4gm6xhiKiMqGx18g4WtQ6wVr4nBdSxY5'
const activeKey = '5K67PNheLkmxkgJ5UjvR8Nyt3GVPoLEN1dMZjFuNETzrNyMecPG'
const json_metadata = '{}'
const max_token_count = 10

golos.broadcast.nftCollection(postingKey, 'cyberfounder', 'COOLGAME',
golos.broadcast.nftCollection(activeKey, 'cyberfounder', 'COOLGAME',
json_metadata, max_token_count, [], (err, res) => {
console.log(err, res)
})
Expand Down Expand Up @@ -84,9 +84,9 @@ issueIt()
### Удаление NFT-коллекции

```js
const postingKey = '5HwQScueMZdELZpjVBD4gm6xhiKiMqGx18g4WtQ6wVr4nBdSxY5'
const activeKey = '5K67PNheLkmxkgJ5UjvR8Nyt3GVPoLEN1dMZjFuNETzrNyMecPG'

golos.broadcast.nftCollectionDelete(postingKey, 'cyberfounder', 'ABC', [], (err, res) => {
golos.broadcast.nftCollectionDelete(activeKey, 'cyberfounder', 'ABC', [], (err, res) => {
console.log(err, res)
})
```
Expand Down Expand Up @@ -229,10 +229,14 @@ golos.api.getNftTokens({
// filter_creators: [],
// filter_token_ids: [],
// filter_names: [], // игнорировать токены из этих коллекций
// state: 'any', // или 'selling_one' - только токены которые выставлены на продажу, или 'not_selling_one' - только которые не выставлены
// state: 'any_not_burnt', // 'selling_one' - только токены которые выставлены на продажу, или 'not_selling_one' - только которые не выставлены; 'burnt_only', 'any'
// sort: 'by_name', // by_issued, by_last_update, by_last_price
// reverse_sort: false
// reverse_sort: false,
// illformed: 'sort_down', // 'nothing', 'ignore' - what to do with tokens without title and/or image
// selling_sorting: 'nothing', // 'sort_up', 'sort_up_by_price'
// sorting_priority: 'selling' // 'illformed'
}, (err, res) => {
//alert(JSON.stringify(err) + ' ' + JSON.stringify(res))
console.log(err, res)
Expand Down
2 changes: 1 addition & 1 deletion golos-lib-js/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "golos-lib-js",
"version": "0.9.58",
"version": "0.9.64",
"description": "Golos-js the JavaScript library with API for GOLOS blockchain",
"main": "lib/index.js",
"scripts": {
Expand Down
43 changes: 34 additions & 9 deletions golos-lib-js/src/api/methods.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,11 @@ module.exports = [
"method": "get_ops_in_block",
"params": ["blockNum", "onlyVirtual"]
},
{
"api": "operation_history",
"method": "get_nft_token_ops",
"params": ["query"]
},
{
"api": "operation_history",
"method": "get_transaction",
Expand Down Expand Up @@ -299,6 +304,16 @@ module.exports = [
"method": "get_donates_for_targets",
"params": ["targets", "limit", "offset", "join_froms"]
},
{
"api": "social_network",
"method": "get_referrals",
"params": ["query"]
},
{
"api": "social_network",
"method": "get_referrers",
"params": ["query"]
},
{
"api": "database_api",
"method": "get_block_header",
Expand Down Expand Up @@ -711,41 +726,51 @@ module.exports = [
{
"api": "paid_subscription_api",
"method": "get_paid_subscriptions_by_author",
"params": ["query"]
"params": ["query={}"]
},
{
"api": "paid_subscription_api",
"method": "get_paid_subscription_options",
"params": ["query"]
"params": ["query={}"]
},
{
"api": "paid_subscription_api",
"method": "get_paid_subscribers",
"params": ["query"]
"params": ["query={}"]
},
{
"api": "paid_subscription_api",
"method": "get_paid_subscriptions",
"params": ["query"]
"params": ["query={}"]
},
{
"api": "paid_subscription_api",
"method": "get_paid_subscribe",
"params": ["query"]
"params": ["query={}"]
},
{
"api": "nft_api",
"method": "get_nft_collections",
"params": ["query"]
"params": ["query={}"]
},
{
"api": "nft_api",
"method": "get_nft_tokens",
"params": ["query"]
"params": ["query={}"]
},
{
"api": "nft_api",
"method": "get_nft_orders",
"params": ["query"]
}
"params": ["query={}"]
},
{
"api": "cryptor",
"method": "encrypt_body",
"params": ["query={}"]
},
{
"api": "cryptor",
"method": "decrypt_comments",
"params": ["query={}"]
},
]
7 changes: 6 additions & 1 deletion golos-lib-js/src/api/transports/ws.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,12 @@ export default class WsTransport extends Transport {
}

stop() {
if (this.ws) this.ws.close();
if (this.ws) {
try {
this.listenTo(this.ws, 'error', (error) => {})
this.ws.close()
} catch (err) {}
}
delete this.startP;
delete this.ws;
this.releases.forEach((release) => release());
Expand Down
9 changes: 8 additions & 1 deletion golos-lib-js/src/auth/serializer/src/operations.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,12 @@ const comment_curation_rewards_percent = new Serializer(
}
);

const comment_decrypt_fee = new Serializer(
3, {
fee: asset
}
);

const account_referral = new Serializer(
0, {
referrer: string,
Expand Down Expand Up @@ -415,6 +421,7 @@ let comment_options = new Serializer(
comment_payout_beneficiaries,
comment_auction_window_reward_destination,
comment_curation_rewards_percent,
comment_decrypt_fee,
]))
}
);
Expand Down Expand Up @@ -1483,7 +1490,7 @@ let nft_buy = new Serializer(

let nft_cancel_order = new Serializer(
"nft_cancel_order", {
seller: string,
owner: string,
order_id: uint32,
extensions: set(future_extensions)
}
Expand Down
6 changes: 3 additions & 3 deletions golos-lib-js/src/broadcast/operations.js
Original file line number Diff line number Diff line change
Expand Up @@ -854,7 +854,7 @@ module.exports = [
]
},
{
"roles": ["posting"],
"roles": ["active"],
"operation": "nft_collection",
"params": [
"creator",
Expand All @@ -865,7 +865,7 @@ module.exports = [
]
},
{
"roles": ["posting"],
"roles": ["active"],
"operation": "nft_collection_delete",
"params": [
"creator",
Expand Down Expand Up @@ -923,7 +923,7 @@ module.exports = [
"roles": ["active"],
"operation": "nft_cancel_order",
"params": [
"seller",
"owner",
"order_id",
"extensions"
]
Expand Down
7 changes: 6 additions & 1 deletion golos-lib-js/test/methods_by_version.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ export const methods_0_25_3 = [
"get_active_witnesses",
"get_all_content_replies",
"get_all_discussions_by_active",
"get_referrals",
"get_referrers",
"get_block",
"get_block_header",
"get_chain_properties",
Expand Down Expand Up @@ -60,6 +62,7 @@ export const methods_0_25_3 = [
"get_miner_queue",
"get_next_scheduled_hardfork",
"get_ops_in_block",
"get_nft_token_ops",
"get_order_book",
"get_order_book_extended",
"get_orders",
Expand Down Expand Up @@ -126,5 +129,7 @@ export const methods_0_25_3 = [
"get_paid_subscribe",
"get_nft_collections",
"get_nft_tokens",
"get_nft_orders"
"get_nft_orders",
"encrypt_body",
"decrypt_comments"
]

0 comments on commit e612428

Please sign in to comment.