atomicassets
Advanced tools
Comparing version 0.5.1 to 0.6.0
@@ -26,5 +26,5 @@ export declare type EosioAuthorizationObject = { | ||
addnotifyacc(authorization: EosioAuthorizationObject[], collection_name: string, account_to_add: string): Promise<EosioActionObject[]>; | ||
admincoledit(authorization: EosioAuthorizationObject[], collection_format_extension: Format[]): Promise<EosioActionObject[]>; | ||
backsymbol(authorization: EosioAuthorizationObject[], ram_payer: string, owner: string, asset_id: string, symbol_to_announce: string, token_contract: string, quantity: string): Promise<EosioActionObject[]>; | ||
burnasset(authorization: EosioAuthorizationObject[], owner: string, asset_id: string): Promise<EosioActionObject[]>; | ||
announcedepo(authorization: EosioAuthorizationObject[], owner: string, symbol_to_announce: string): Promise<EosioActionObject[]>; | ||
backasset(authorization: EosioAuthorizationObject[], payer: string, asset_owner: string, asset_id: string, token_to_back: string): Promise<EosioActionObject[]>; | ||
burnasset(authorization: EosioAuthorizationObject[], asset_owner: string, asset_id: string): Promise<EosioActionObject[]>; | ||
canceloffer(authorization: EosioAuthorizationObject[], offer_id: string): Promise<EosioActionObject[]>; | ||
@@ -38,10 +38,12 @@ createcol(authorization: EosioAuthorizationObject[], author: string, collection_name: string, allow_notify: boolean, authorized_accounts: string[], notify_accounts: string[], market_fee: number, data: AttributeMap): Promise<EosioActionObject[]>; | ||
forbidnotify(authorization: EosioAuthorizationObject[], collection_name: string): Promise<EosioActionObject[]>; | ||
mintasset(authorization: EosioAuthorizationObject[], authorized_minter: string, collection_name: string, scheme_name: string, preset_id: string, new_owner: string, immutable_data: AttributeMap, mutable_data: AttributeMap): Promise<EosioActionObject[]>; | ||
mintasset(authorization: EosioAuthorizationObject[], authorized_minter: string, collection_name: string, scheme_name: string, preset_id: string, new_asset_owner: string, immutable_data: AttributeMap, mutable_data: AttributeMap, tokens_to_back: string[]): Promise<EosioActionObject[]>; | ||
payofferram(authorization: EosioAuthorizationObject[], payer: string, offer_id: string): Promise<EosioActionObject[]>; | ||
remcolauth(authorization: EosioAuthorizationObject[], collection_name: string, account_to_remove: string): Promise<EosioActionObject[]>; | ||
remnotifyacc(authorization: EosioAuthorizationObject[], collection_name: string, account_to_remove: string): Promise<EosioActionObject[]>; | ||
setassetdata(authorization: EosioAuthorizationObject[], authorized_editor: string, owner: string, asset_id: string, new_mutable_data: AttributeMap): Promise<EosioActionObject[]>; | ||
setassetdata(authorization: EosioAuthorizationObject[], authorized_editor: string, asset_owner: string, asset_id: string, new_mutable_data: AttributeMap): Promise<EosioActionObject[]>; | ||
setcoldata(authorization: EosioAuthorizationObject[], collection_name: string, data: AttributeMap): Promise<EosioActionObject[]>; | ||
setmarketfee(authorization: EosioAuthorizationObject[], collection_name: string, market_fee: number): Promise<EosioActionObject[]>; | ||
transfer(authorization: EosioAuthorizationObject[], account_from: string, account_to: string, asset_ids: string[], memo: string): Promise<EosioActionObject[]>; | ||
withdraw(authorization: EosioAuthorizationObject[], owner: string, token_to_withdraw: string): Promise<EosioActionObject[]>; | ||
protected _pack(authorization: EosioAuthorizationObject[], name: string, data: any): EosioActionObject[]; | ||
} |
@@ -20,17 +20,10 @@ "use strict"; | ||
} | ||
async admincoledit(authorization, collection_format_extension) { | ||
return this._pack(authorization, "admincoledit", { collection_format_extension }); | ||
async announcedepo(authorization, owner, symbol_to_announce) { | ||
return this._pack(authorization, "announcedepo", { owner, symbol_to_announce }); | ||
} | ||
async backsymbol(authorization, ram_payer, owner, asset_id, symbol_to_announce, token_contract, quantity) { | ||
const actions = this._pack(authorization, "backsymbol", { ram_payer, owner, asset_id, symbol_to_announce }); | ||
actions.push({ | ||
account: token_contract, | ||
name: "transfer", | ||
authorization, | ||
data: { from: ram_payer, to: this.contract, quantity: quantity + " " + symbol_to_announce }, | ||
}); | ||
return actions; | ||
async backasset(authorization, payer, asset_owner, asset_id, token_to_back) { | ||
return this._pack(authorization, "backasset", { payer, asset_owner, asset_id, token_to_back }); | ||
} | ||
async burnasset(authorization, owner, asset_id) { | ||
return this._pack(authorization, "burnasset", { owner, asset_id }); | ||
async burnasset(authorization, asset_owner, asset_id) { | ||
return this._pack(authorization, "burnasset", { asset_owner, asset_id }); | ||
} | ||
@@ -63,5 +56,10 @@ async canceloffer(authorization, offer_id) { | ||
} | ||
async mintasset(authorization, authorized_minter, collection_name, scheme_name, preset_id, new_owner, immutable_data, mutable_data) { | ||
return this._pack(authorization, "mintasset", { authorized_minter, collection_name, scheme_name, preset_id, new_owner, immutable_data, mutable_data }); | ||
async mintasset(authorization, authorized_minter, collection_name, scheme_name, preset_id, new_asset_owner, immutable_data, mutable_data, tokens_to_back) { | ||
return this._pack(authorization, "mintasset", { | ||
authorized_minter, collection_name, scheme_name, preset_id, new_asset_owner, immutable_data, mutable_data, tokens_to_back, | ||
}); | ||
} | ||
async payofferram(authorization, payer, offer_id) { | ||
return this._pack(authorization, "payofferram", { payer, offer_id }); | ||
} | ||
async remcolauth(authorization, collection_name, account_to_remove) { | ||
@@ -73,4 +71,4 @@ return this._pack(authorization, "remcolauth", { collection_name, account_to_remove }); | ||
} | ||
async setassetdata(authorization, authorized_editor, owner, asset_id, new_mutable_data) { | ||
return this._pack(authorization, "setassetdata", { authorized_editor, owner, asset_id, new_mutable_data }); | ||
async setassetdata(authorization, authorized_editor, asset_owner, asset_id, new_mutable_data) { | ||
return this._pack(authorization, "setassetdata", { authorized_editor, asset_owner, asset_id, new_mutable_data }); | ||
} | ||
@@ -86,2 +84,5 @@ async setcoldata(authorization, collection_name, data) { | ||
} | ||
async withdraw(authorization, owner, token_to_withdraw) { | ||
return this._pack(authorization, "withdraw", { owner, token_to_withdraw }); | ||
} | ||
_pack(authorization, name, data) { | ||
@@ -88,0 +89,0 @@ return [{ account: this.contract, name, authorization, data }]; |
@@ -9,5 +9,5 @@ import RpcApi from "../API/Rpc"; | ||
createpreset(authorization: EosioAuthorizationObject[], authorized_creator: string, collection_name: string, scheme_name: string, transferable: boolean, burnable: boolean, max_supply: string, immutable_data: object): Promise<import("./Generator").EosioActionObject[]>; | ||
mintasset(authorization: EosioAuthorizationObject[], authorized_minter: string, collection_name: string, scheme_name: string, preset_id: string, new_owner: string, immutable_data: object, mutable_data: object): Promise<import("./Generator").EosioActionObject[]>; | ||
mintasset(authorization: EosioAuthorizationObject[], authorized_minter: string, collection_name: string, scheme_name: string, preset_id: string, new_owner: string, immutable_data: object, mutable_data: object, tokens_to_back: string[]): Promise<import("./Generator").EosioActionObject[]>; | ||
setassetdata(authorization: EosioAuthorizationObject[], authorized_editor: string, owner: string, asset_id: string, mutable_data: object): Promise<import("./Generator").EosioActionObject[]>; | ||
setcoldata(authorization: EosioAuthorizationObject[], collection_name: string, data: object): Promise<import("./Generator").EosioActionObject[]>; | ||
} |
@@ -38,7 +38,7 @@ "use strict"; | ||
} | ||
async mintasset(authorization, authorized_minter, collection_name, scheme_name, preset_id, new_owner, immutable_data, mutable_data) { | ||
async mintasset(authorization, authorized_minter, collection_name, scheme_name, preset_id, new_owner, immutable_data, mutable_data, tokens_to_back) { | ||
const preset = await this.api.getPreset(collection_name, preset_id); | ||
const immutable_attribute_map = RpcActionGenerator.toAttributeMap(immutable_data, await (await preset.scheme()).rawFormat()); | ||
const mutable_attribute_map = RpcActionGenerator.toAttributeMap(mutable_data, await (await preset.scheme()).rawFormat()); | ||
return super.mintasset(authorization, authorized_minter, collection_name, scheme_name, preset_id, new_owner, immutable_attribute_map, mutable_attribute_map); | ||
return super.mintasset(authorization, authorized_minter, collection_name, scheme_name, preset_id, new_owner, immutable_attribute_map, mutable_attribute_map, tokens_to_back); | ||
} | ||
@@ -45,0 +45,0 @@ async setassetdata(authorization, authorized_editor, owner, asset_id, mutable_data) { |
@@ -40,4 +40,4 @@ export declare type SchemeFormat = Array<{ | ||
offer_id: string; | ||
offer_sender: string; | ||
offer_recipient: string; | ||
sender: string; | ||
recipient: string; | ||
sender_asset_ids: string[]; | ||
@@ -44,0 +44,0 @@ recipient_asset_ids: string[]; |
@@ -27,3 +27,3 @@ "use strict"; | ||
async allowNotify() { | ||
return !!(await this._data).allow_notify; | ||
return (await this._data).allow_notify; | ||
} | ||
@@ -30,0 +30,0 @@ async authorizedAccounts() { |
@@ -31,6 +31,6 @@ "use strict"; | ||
const row = await this._data; | ||
const inventory = await this.api.queue.account_assets(row.offer_sender, cache); | ||
const inventory = await this.api.queue.account_assets(row.sender, cache); | ||
return resolve(row.sender_asset_ids.map((assetID) => { | ||
const asset = inventory.find((assetRow) => assetRow.asset_id === assetID); | ||
return asset ? new Asset_1.default(this.api, row.offer_sender, assetID, asset, undefined, undefined, undefined, cache) : assetID; | ||
return asset ? new Asset_1.default(this.api, row.sender, assetID, asset, undefined, undefined, undefined, cache) : assetID; | ||
})); | ||
@@ -50,6 +50,6 @@ } | ||
const row = await this._data; | ||
const inventory = await this.api.queue.account_assets(row.offer_recipient, cache); | ||
const inventory = await this.api.queue.account_assets(row.recipient, cache); | ||
return resolve(row.recipient_asset_ids.map((assetID) => { | ||
const asset = inventory.find((assetRow) => assetRow.asset_id === assetID); | ||
return asset ? new Asset_1.default(this.api, row.offer_recipient, assetID, asset, undefined, undefined, undefined, cache) : assetID; | ||
return asset ? new Asset_1.default(this.api, row.recipient, assetID, asset, undefined, undefined, undefined, cache) : assetID; | ||
})); | ||
@@ -64,6 +64,6 @@ } | ||
async sender() { | ||
return (await this._data).offer_sender; | ||
return (await this._data).sender; | ||
} | ||
async recipient() { | ||
return (await this._data).offer_recipient; | ||
return (await this._data).recipient; | ||
} | ||
@@ -70,0 +70,0 @@ async senderAssets() { |
@@ -48,6 +48,6 @@ "use strict"; | ||
async isTransferable() { | ||
return !!(await this._data).transferable; | ||
return (await this._data).transferable; | ||
} | ||
async isBurnable() { | ||
return !!(await this._data).burnable; | ||
return (await this._data).burnable; | ||
} | ||
@@ -54,0 +54,0 @@ async maxSupply() { |
@@ -12,3 +12,3 @@ { | ||
"license": "MIT", | ||
"version": "0.5.1", | ||
"version": "0.6.0", | ||
"main": "build/index.js", | ||
@@ -15,0 +15,0 @@ "types": "build/index.d.ts", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
132180
2979