@0xcert/scaffold
Advanced tools
Comparing version 0.0.0-alpha7 to 0.0.0-alpha8
@@ -5,4 +5,4 @@ { | ||
{ | ||
"version": "0.0.0-alpha7", | ||
"tag": "@0xcert/scaffold_v0.0.0-alpha7", | ||
"version": "0.0.0-alpha8", | ||
"tag": "@0xcert/scaffold_v0.0.0-alpha8", | ||
"date": "Thu, 22 Nov 2018 00:51:03 GMT", | ||
@@ -9,0 +9,0 @@ "comments": {} |
@@ -5,3 +5,3 @@ # Change Log - @0xcert/scaffold | ||
## 0.0.0-alpha7 | ||
## 0.0.0-alpha8 | ||
Thu, 22 Nov 2018 00:51:03 GMT | ||
@@ -8,0 +8,0 @@ |
@@ -1,41 +0,44 @@ | ||
import { MutationBase } from "./misc"; | ||
import { MutationBase } from "./mutation"; | ||
import { OrderGatewayBase } from "./order-gateway"; | ||
export declare enum AssetLedgerAbility { | ||
MANAGE_ABILITIES = 0, | ||
MINT_ASSET = 1, | ||
CREATE_ASSET = 1, | ||
REVOKE_ASSET = 2, | ||
PAUSE_TRANSFER = 3, | ||
UPDATE_PROOF = 4, | ||
SIGN_MINT_CLAIM = 5 | ||
TOGGLE_TRANSFERS = 3, | ||
UPDATE_ASSET = 4, | ||
ALLOW_CREATE_ASSET = 5, | ||
UPDATE_URI_BASE = 6 | ||
} | ||
export declare enum AssetLedgerCapability { | ||
BURN = 1, | ||
UPDATE_IMPRINT = 2, | ||
TOGGLE_TRANSFER = 3, | ||
REVOKE = 4 | ||
DESTROY_ASSET = 1, | ||
UPDATE_ASSET = 2, | ||
REVOKE_ASSET = 4, | ||
TOGGLE_TRANSFERS = 3 | ||
} | ||
export interface AssetLedgerBase { | ||
readonly id: string; | ||
approveAccount(assetId: string, accountId: string | OrderGatewayBase): Promise<MutationBase>; | ||
approveOperator(accountId: string | OrderGatewayBase): Promise<MutationBase>; | ||
assignAbilities(accountId: string, abilities: AssetLedgerAbility[]): Promise<MutationBase>; | ||
createAsset(recipe: AssetLedgerItemRecipe): Promise<MutationBase>; | ||
destroyAsset(assetId: string): Promise<MutationBase>; | ||
disapproveAccount(assetId: string): Promise<MutationBase>; | ||
disapproveOperator(accountId: string | OrderGatewayBase): Promise<MutationBase>; | ||
disableTransfers(): Promise<MutationBase>; | ||
enableTransfers(): Promise<MutationBase>; | ||
getAbilities(accountId: string): Promise<AssetLedgerAbility[]>; | ||
getApprovedAccount(assetId: string): Promise<string>; | ||
getAsset(assetId: string): Promise<AssetLedgerItem>; | ||
getAssetAccount(assetId: string): Promise<string>; | ||
getAsset(assetId: string): Promise<AssetLedgerItem>; | ||
getBalance(accountId: string): Promise<string>; | ||
getCapabilities(): Promise<AssetLedgerCapability[]>; | ||
getInfo(): Promise<AssetLedgerInfo>; | ||
isApprovedAccount(accountId: string, assetId: string): Promise<boolean>; | ||
isApprovedAccount(assetId: string, accountId: string | OrderGatewayBase): Promise<boolean>; | ||
isApprovedOperator(accountId: string, operatorId: string | OrderGatewayBase): Promise<boolean>; | ||
isTransferable(): Promise<boolean>; | ||
isApprovedOperator(accountId: string, operatorId: string): Promise<boolean>; | ||
approveAccount(accountId: string, tokenId: string): Promise<MutationBase>; | ||
assignAbilities(accountId: string, abilities: AssetLedgerAbility[]): Promise<MutationBase>; | ||
createAsset(recipe: AssetLedgerItemRecipe): Promise<MutationBase>; | ||
destroyAsset(assetId: string): Promise<MutationBase>; | ||
revokeAbilities(accountId: string, abilities: AssetLedgerAbility[]): Promise<MutationBase>; | ||
revokeAsset(assetId: string): Promise<MutationBase>; | ||
update(recipe: AssetLedgerUpdateRecipe): Promise<MutationBase>; | ||
updateAsset(assetId: string, recipe: AssetLedgerObjectUpdateRecipe): Promise<MutationBase>; | ||
transferAsset(recipe: AssetLedgerTransferRecipe): Promise<MutationBase>; | ||
enableTransfer(): Promise<MutationBase>; | ||
disableTransfer(): Promise<MutationBase>; | ||
updateAsset(assetId: string, recipe: AssetLedgerObjectUpdateRecipe): Promise<MutationBase>; | ||
update(recipe: AssetLedgerUpdateRecipe): Promise<MutationBase>; | ||
approveOperator(accountId: string): Promise<MutationBase>; | ||
disapproveOperator(accountId: string): Promise<MutationBase>; | ||
} | ||
@@ -42,0 +45,0 @@ export interface AssetLedgerDeployRecipe { |
@@ -6,15 +6,16 @@ "use strict"; | ||
AssetLedgerAbility[AssetLedgerAbility["MANAGE_ABILITIES"] = 0] = "MANAGE_ABILITIES"; | ||
AssetLedgerAbility[AssetLedgerAbility["MINT_ASSET"] = 1] = "MINT_ASSET"; | ||
AssetLedgerAbility[AssetLedgerAbility["CREATE_ASSET"] = 1] = "CREATE_ASSET"; | ||
AssetLedgerAbility[AssetLedgerAbility["REVOKE_ASSET"] = 2] = "REVOKE_ASSET"; | ||
AssetLedgerAbility[AssetLedgerAbility["PAUSE_TRANSFER"] = 3] = "PAUSE_TRANSFER"; | ||
AssetLedgerAbility[AssetLedgerAbility["UPDATE_PROOF"] = 4] = "UPDATE_PROOF"; | ||
AssetLedgerAbility[AssetLedgerAbility["SIGN_MINT_CLAIM"] = 5] = "SIGN_MINT_CLAIM"; | ||
AssetLedgerAbility[AssetLedgerAbility["TOGGLE_TRANSFERS"] = 3] = "TOGGLE_TRANSFERS"; | ||
AssetLedgerAbility[AssetLedgerAbility["UPDATE_ASSET"] = 4] = "UPDATE_ASSET"; | ||
AssetLedgerAbility[AssetLedgerAbility["ALLOW_CREATE_ASSET"] = 5] = "ALLOW_CREATE_ASSET"; | ||
AssetLedgerAbility[AssetLedgerAbility["UPDATE_URI_BASE"] = 6] = "UPDATE_URI_BASE"; | ||
})(AssetLedgerAbility = exports.AssetLedgerAbility || (exports.AssetLedgerAbility = {})); | ||
var AssetLedgerCapability; | ||
(function (AssetLedgerCapability) { | ||
AssetLedgerCapability[AssetLedgerCapability["BURN"] = 1] = "BURN"; | ||
AssetLedgerCapability[AssetLedgerCapability["UPDATE_IMPRINT"] = 2] = "UPDATE_IMPRINT"; | ||
AssetLedgerCapability[AssetLedgerCapability["TOGGLE_TRANSFER"] = 3] = "TOGGLE_TRANSFER"; | ||
AssetLedgerCapability[AssetLedgerCapability["REVOKE"] = 4] = "REVOKE"; | ||
AssetLedgerCapability[AssetLedgerCapability["DESTROY_ASSET"] = 1] = "DESTROY_ASSET"; | ||
AssetLedgerCapability[AssetLedgerCapability["UPDATE_ASSET"] = 2] = "UPDATE_ASSET"; | ||
AssetLedgerCapability[AssetLedgerCapability["REVOKE_ASSET"] = 4] = "REVOKE_ASSET"; | ||
AssetLedgerCapability[AssetLedgerCapability["TOGGLE_TRANSFERS"] = 3] = "TOGGLE_TRANSFERS"; | ||
})(AssetLedgerCapability = exports.AssetLedgerCapability || (exports.AssetLedgerCapability = {})); | ||
//# sourceMappingURL=asset-ledger.js.map |
@@ -1,3 +0,7 @@ | ||
import { Order } from "./order"; | ||
import { MutationBase } from "./misc"; | ||
import { MutationBase } from "./mutation"; | ||
export declare enum OrderActionKind { | ||
CREATE_ASSET = 1, | ||
TRANSFER_ASSET = 2, | ||
TRANSFER_VALUE = 3 | ||
} | ||
export interface OrderGatewayBase { | ||
@@ -9,1 +13,31 @@ readonly id: string; | ||
} | ||
export declare type OrderAction = OrderActionCreateAsset | OrderActionTransferAsset | OrderActionTransferValue; | ||
export interface OrderActionCreateAsset { | ||
kind: OrderActionKind.CREATE_ASSET; | ||
ledgerId: string; | ||
senderId: string; | ||
receiverId: string; | ||
assetId: string; | ||
assetImprint: string; | ||
} | ||
export interface OrderActionTransferAsset { | ||
kind: OrderActionKind.TRANSFER_ASSET; | ||
ledgerId: string; | ||
senderId: string; | ||
receiverId: string; | ||
assetId: string; | ||
} | ||
export interface OrderActionTransferValue { | ||
kind: OrderActionKind.TRANSFER_VALUE; | ||
ledgerId: string; | ||
senderId: string; | ||
receiverId: string; | ||
value: string; | ||
} | ||
export declare class Order { | ||
makerId: string; | ||
takerId: string; | ||
actions: OrderAction[]; | ||
seed: number; | ||
expiration: number; | ||
} |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var OrderActionKind; | ||
(function (OrderActionKind) { | ||
OrderActionKind[OrderActionKind["CREATE_ASSET"] = 1] = "CREATE_ASSET"; | ||
OrderActionKind[OrderActionKind["TRANSFER_ASSET"] = 2] = "TRANSFER_ASSET"; | ||
OrderActionKind[OrderActionKind["TRANSFER_VALUE"] = 3] = "TRANSFER_VALUE"; | ||
})(OrderActionKind = exports.OrderActionKind || (exports.OrderActionKind = {})); | ||
class Order { | ||
} | ||
exports.Order = Order; | ||
//# sourceMappingURL=order-gateway.js.map |
@@ -5,27 +5,3 @@ export interface ProviderBase { | ||
export declare enum ProviderIssue { | ||
UNHANDLED = 0, | ||
GENERAL_REVERT = 1, | ||
SIGNATURE_UNKNOWN = 9000, | ||
SIGNATURE_FAILED = 9001, | ||
ZERO_ADDRESS = 1001, | ||
INVALID_NFT = 1002, | ||
NOT_AUTHORIZED = 1003, | ||
RECEIVER_DOES_NOT_SUPPORT_NFT = 1004, | ||
NFT_ALREADY_EXISTS = 1005, | ||
INVALID_INDEX = 1006, | ||
TRANSFERS_PAUSED = 1007, | ||
COIN_TRANSFER_FAILED = 1008, | ||
INVALID_SIGNATURE_KIND = 1009, | ||
INVALID_PROXY = 1010, | ||
YOU_ARE_NOT_THE_TAKER = 1011, | ||
SENDER_NOT_TAKER_OR_MAKER = 1012, | ||
ORDER_EXPIRED = 1013, | ||
INVALID_SIGNATURE = 1014, | ||
ORDER_CANCELED = 1015, | ||
ORDER_CANNOT_BE_PERFORMED_TWICE = 1016, | ||
YOU_ARE_NOT_THE_MAKER = 1017, | ||
SIGNER_NOT_AUTHORIZED = 1018, | ||
ONE_ZERO_ABILITY_HAS_TO_EXIST = 1019, | ||
TRANSATION_RESPONSE_ERROR_CHECK_PENDING_TRANSACTIONS = 2001, | ||
INVALID_ADDRESS = 2002 | ||
GENERAL = 0 | ||
} | ||
@@ -32,0 +8,0 @@ export declare class ProviderError extends Error { |
@@ -5,27 +5,3 @@ "use strict"; | ||
(function (ProviderIssue) { | ||
ProviderIssue[ProviderIssue["UNHANDLED"] = 0] = "UNHANDLED"; | ||
ProviderIssue[ProviderIssue["GENERAL_REVERT"] = 1] = "GENERAL_REVERT"; | ||
ProviderIssue[ProviderIssue["SIGNATURE_UNKNOWN"] = 9000] = "SIGNATURE_UNKNOWN"; | ||
ProviderIssue[ProviderIssue["SIGNATURE_FAILED"] = 9001] = "SIGNATURE_FAILED"; | ||
ProviderIssue[ProviderIssue["ZERO_ADDRESS"] = 1001] = "ZERO_ADDRESS"; | ||
ProviderIssue[ProviderIssue["INVALID_NFT"] = 1002] = "INVALID_NFT"; | ||
ProviderIssue[ProviderIssue["NOT_AUTHORIZED"] = 1003] = "NOT_AUTHORIZED"; | ||
ProviderIssue[ProviderIssue["RECEIVER_DOES_NOT_SUPPORT_NFT"] = 1004] = "RECEIVER_DOES_NOT_SUPPORT_NFT"; | ||
ProviderIssue[ProviderIssue["NFT_ALREADY_EXISTS"] = 1005] = "NFT_ALREADY_EXISTS"; | ||
ProviderIssue[ProviderIssue["INVALID_INDEX"] = 1006] = "INVALID_INDEX"; | ||
ProviderIssue[ProviderIssue["TRANSFERS_PAUSED"] = 1007] = "TRANSFERS_PAUSED"; | ||
ProviderIssue[ProviderIssue["COIN_TRANSFER_FAILED"] = 1008] = "COIN_TRANSFER_FAILED"; | ||
ProviderIssue[ProviderIssue["INVALID_SIGNATURE_KIND"] = 1009] = "INVALID_SIGNATURE_KIND"; | ||
ProviderIssue[ProviderIssue["INVALID_PROXY"] = 1010] = "INVALID_PROXY"; | ||
ProviderIssue[ProviderIssue["YOU_ARE_NOT_THE_TAKER"] = 1011] = "YOU_ARE_NOT_THE_TAKER"; | ||
ProviderIssue[ProviderIssue["SENDER_NOT_TAKER_OR_MAKER"] = 1012] = "SENDER_NOT_TAKER_OR_MAKER"; | ||
ProviderIssue[ProviderIssue["ORDER_EXPIRED"] = 1013] = "ORDER_EXPIRED"; | ||
ProviderIssue[ProviderIssue["INVALID_SIGNATURE"] = 1014] = "INVALID_SIGNATURE"; | ||
ProviderIssue[ProviderIssue["ORDER_CANCELED"] = 1015] = "ORDER_CANCELED"; | ||
ProviderIssue[ProviderIssue["ORDER_CANNOT_BE_PERFORMED_TWICE"] = 1016] = "ORDER_CANNOT_BE_PERFORMED_TWICE"; | ||
ProviderIssue[ProviderIssue["YOU_ARE_NOT_THE_MAKER"] = 1017] = "YOU_ARE_NOT_THE_MAKER"; | ||
ProviderIssue[ProviderIssue["SIGNER_NOT_AUTHORIZED"] = 1018] = "SIGNER_NOT_AUTHORIZED"; | ||
ProviderIssue[ProviderIssue["ONE_ZERO_ABILITY_HAS_TO_EXIST"] = 1019] = "ONE_ZERO_ABILITY_HAS_TO_EXIST"; | ||
ProviderIssue[ProviderIssue["TRANSATION_RESPONSE_ERROR_CHECK_PENDING_TRANSACTIONS"] = 2001] = "TRANSATION_RESPONSE_ERROR_CHECK_PENDING_TRANSACTIONS"; | ||
ProviderIssue[ProviderIssue["INVALID_ADDRESS"] = 2002] = "INVALID_ADDRESS"; | ||
ProviderIssue[ProviderIssue["GENERAL"] = 0] = "GENERAL"; | ||
})(ProviderIssue = exports.ProviderIssue || (exports.ProviderIssue = {})); | ||
@@ -32,0 +8,0 @@ class ProviderError extends Error { |
@@ -1,8 +0,12 @@ | ||
import { MutationBase } from "./misc"; | ||
import { MutationBase } from "./mutation"; | ||
import { OrderGatewayBase } from "./order-gateway"; | ||
export interface ValueLedgerBase { | ||
readonly id: string; | ||
approveValue(value: string, accountId: string | OrderGatewayBase): Promise<MutationBase>; | ||
disapproveValue(accountId: string | OrderGatewayBase): Promise<MutationBase>; | ||
getApprovedValue(accountId: string, spenderId: string): Promise<String>; | ||
getBalance(accountId: string): Promise<string>; | ||
getInfo(): Promise<ValueLedgerInfo>; | ||
approveValue(accountId: string, value: string): Promise<MutationBase>; | ||
disapproveValue(accountId: string): Promise<MutationBase>; | ||
isApprovedValue(value: string, accountId: string | OrderGatewayBase, spenderId: string): Promise<Boolean>; | ||
transferValue(recipe: ValueLedgerTransferRecipe): Promise<MutationBase>; | ||
} | ||
@@ -9,0 +13,0 @@ export interface ValueLedgerDeployRecipe { |
export * from './assets/metadata'; | ||
export * from './core/provider'; | ||
export * from './core/asset-ledger'; | ||
export * from './core/misc'; | ||
export * from './core/mutation'; | ||
export * from './core/order-gateway'; | ||
export * from './core/order'; | ||
export * from './core/value-ledger'; |
@@ -8,3 +8,4 @@ "use strict"; | ||
__export(require("./core/asset-ledger")); | ||
__export(require("./core/order")); | ||
__export(require("./core/mutation")); | ||
__export(require("./core/order-gateway")); | ||
//# sourceMappingURL=index.js.map |
{ | ||
"files": { | ||
"packages/0xcert-scaffold/CHANGELOG.json": "cd6e3c22a5e7739e26f6bb175dcff40486e25351", | ||
"packages/0xcert-scaffold/CHANGELOG.md": "d17b3a6eb6364edd94204c97ee5d0dac0cd2ff00", | ||
"packages/0xcert-scaffold/CHANGELOG.json": "526c089cfa2a4fcd2197b7a8b0d7e3138b1c3426", | ||
"packages/0xcert-scaffold/CHANGELOG.md": "4d1f3974d2cc489b5bf76dad2bfc6cb6494e3550", | ||
"packages/0xcert-scaffold/README.md": "933ab183f046792b1b71fedb1d994849801d87fb", | ||
"packages/0xcert-scaffold/nodemon.json": "82b893373db9861f1df4b55d8ea68a5d37b118de", | ||
"packages/0xcert-scaffold/package.json": "86f36058ea8b219c7107396dfc47bf0574b28956", | ||
"packages/0xcert-scaffold/src/assets/metadata.ts": "1bd04e0ee8b5ab49edbd1c2ba23398b321ed0800", | ||
"packages/0xcert-scaffold/src/core/asset-ledger.ts": "41d767c98f0ad4d382a80c71294e68d2ee7365a5", | ||
"packages/0xcert-scaffold/src/core/misc.ts": "72309ea533f5280ee023c48ebd8770d3c32cd5f6", | ||
"packages/0xcert-scaffold/src/core/order-gateway.ts": "58ae19f48d35ea9bd4a6d7ca53b1a6c64c6b0edb", | ||
"packages/0xcert-scaffold/src/core/order.ts": "00cfa83e4859b2c0d2680346426defef690007bc", | ||
"packages/0xcert-scaffold/src/core/provider.ts": "be596952ce293259d81442f245f66dd5dacbb7a3", | ||
"packages/0xcert-scaffold/src/core/value-ledger.ts": "7bf53e064bf9a677b0ee1fc3ce62a7d33532bf14", | ||
"packages/0xcert-scaffold/src/index.ts": "9689f39dbb95ce6fbb159ee26c26ac6a9f8cfcdd", | ||
"packages/0xcert-scaffold/package.json": "af59a3beeef7461fdccbe3da88dc298d4806f9a6", | ||
"packages/0xcert-scaffold/src/assets/metadata.ts": "b8573c39cae9e723cbad1d668658538c31e70aa7", | ||
"packages/0xcert-scaffold/src/core/asset-ledger.ts": "09f7ffbeabe3299ad0819d31d6daeef5dc4f753c", | ||
"packages/0xcert-scaffold/src/core/mutation.ts": "8c2efeb5779363e04795a4ea3d77350f4d07a15e", | ||
"packages/0xcert-scaffold/src/core/order-gateway.ts": "f3faa4d2762e090005400c2fed00fb9b78503c4e", | ||
"packages/0xcert-scaffold/src/core/provider.ts": "d6aff8d52a9e91ce97ed81feeb064b5009da80fb", | ||
"packages/0xcert-scaffold/src/core/value-ledger.ts": "942fcefeaa10289211d9361b9c03e1b0a27b949d", | ||
"packages/0xcert-scaffold/src/index.ts": "c49becb92b845c5678dbb1aac124c4ad184e9b1d", | ||
"packages/0xcert-scaffold/src/tests/.keep": "e69de29bb2d1d6434b8b29ae775ad8c2e48c5391", | ||
"packages/0xcert-scaffold/tsconfig.json": "99f0fa2e7cf44aa40828236230bc6f15d8648bc6", | ||
"common/config/rush/npm-shrinkwrap.json": "b5af47441ed8345fd5cfe61bc37d9d7008283a33" | ||
"common/config/rush/npm-shrinkwrap.json": "8f19ba9dbdefd16dc6af9aff055b174191c3e0b8" | ||
}, | ||
"arguments": "npm run clean && npx tsc " | ||
"arguments": "npx hayspec test " | ||
} |
{ | ||
"name": "@0xcert/scaffold", | ||
"version": "0.0.0-alpha7", | ||
"description": "0xcert protocol scaffold.", | ||
"version": "0.0.0-alpha8", | ||
"description": "Overarching module with types, enums, and interfaces for easier development of interoperable modules.", | ||
"main": "./dist/index.js", | ||
@@ -20,6 +20,39 @@ "types": "./dist/index.d.ts", | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/0xcert/framework.git" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/0xcert/framework/issues" | ||
}, | ||
"homepage": "https://github.com/0xcert/framework#readme", | ||
"keywords": [ | ||
"0xcert", | ||
"framework", | ||
"protocol", | ||
"asset", | ||
"value", | ||
"values", | ||
"currency", | ||
"token", | ||
"non-fungible", | ||
"fungible", | ||
"erc-721", | ||
"erc-20", | ||
"blockchain", | ||
"javascript", | ||
"typescript", | ||
"nodejs", | ||
"vuejs", | ||
"nuxtjs", | ||
"npm", | ||
"libraries", | ||
"smart-contract", | ||
"ethereum", | ||
"zxc" | ||
], | ||
"license": "MIT", | ||
"devDependencies": { | ||
"@hayspec/cli": "^0.7.6", | ||
"@hayspec/spec": "^0.7.6", | ||
"@hayspec/cli": "^0.8.3", | ||
"@hayspec/spec": "^0.8.3", | ||
"@types/node": "^10.12.10", | ||
@@ -26,0 +59,0 @@ "ts-node": "^7.0.1", |
/** | ||
* | ||
* Definition of asset metadata. | ||
*/ | ||
@@ -4,0 +4,0 @@ export interface AssetMetadata { |
@@ -1,57 +0,60 @@ | ||
import { MutationBase } from "./misc"; | ||
import { MutationBase } from "./mutation"; | ||
import { OrderGatewayBase } from "./order-gateway"; | ||
/** | ||
* | ||
* List of available abilities an account can have per asset ledger. | ||
*/ | ||
export enum AssetLedgerAbility { | ||
MANAGE_ABILITIES = 0, | ||
MINT_ASSET = 1, | ||
CREATE_ASSET = 1, | ||
REVOKE_ASSET = 2, | ||
PAUSE_TRANSFER = 3, | ||
UPDATE_PROOF = 4, | ||
SIGN_MINT_CLAIM = 5, | ||
TOGGLE_TRANSFERS = 3, | ||
UPDATE_ASSET = 4, | ||
ALLOW_CREATE_ASSET = 5, | ||
UPDATE_URI_BASE = 6, | ||
} | ||
/** | ||
* | ||
* List of available asset ledger capabilities. | ||
*/ | ||
export enum AssetLedgerCapability { | ||
BURN = 1, | ||
UPDATE_IMPRINT = 2, | ||
TOGGLE_TRANSFER = 3, | ||
REVOKE = 4, | ||
DESTROY_ASSET = 1, | ||
UPDATE_ASSET = 2, | ||
REVOKE_ASSET = 4, | ||
TOGGLE_TRANSFERS = 3, | ||
} | ||
/** | ||
* | ||
* Asset ledger method definitions. | ||
*/ | ||
export interface AssetLedgerBase { | ||
readonly id: string; | ||
approveAccount(assetId: string, accountId: string | OrderGatewayBase): Promise<MutationBase>; | ||
approveOperator(accountId: string | OrderGatewayBase): Promise<MutationBase>; | ||
assignAbilities(accountId: string, abilities: AssetLedgerAbility[]): Promise<MutationBase>; | ||
createAsset(recipe: AssetLedgerItemRecipe): Promise<MutationBase>; | ||
destroyAsset(assetId: string): Promise<MutationBase>; | ||
disapproveAccount(assetId: string): Promise<MutationBase>; | ||
disapproveOperator(accountId: string | OrderGatewayBase): Promise<MutationBase>; | ||
disableTransfers(): Promise<MutationBase>; | ||
enableTransfers(): Promise<MutationBase>; | ||
getAbilities(accountId: string): Promise<AssetLedgerAbility[]>; | ||
getApprovedAccount(assetId: string): Promise<string>; | ||
getAsset(assetId: string): Promise<AssetLedgerItem>; | ||
getAssetAccount(assetId: string): Promise<string>; | ||
getAsset(assetId: string): Promise<AssetLedgerItem>; | ||
getBalance(accountId: string): Promise<string>; | ||
getCapabilities(): Promise<AssetLedgerCapability[]>; | ||
getInfo(): Promise<AssetLedgerInfo>; | ||
isApprovedAccount(accountId: string, assetId: string): Promise<boolean>; | ||
isApprovedAccount(assetId: string, accountId: string | OrderGatewayBase): Promise<boolean>; | ||
isApprovedOperator(accountId: string, operatorId: string | OrderGatewayBase): Promise<boolean>; | ||
isTransferable(): Promise<boolean>; | ||
isApprovedOperator(accountId: string, operatorId: string): Promise<boolean>; | ||
approveAccount(accountId: string, tokenId: string): Promise<MutationBase>; | ||
assignAbilities(accountId: string, abilities: AssetLedgerAbility[]): Promise<MutationBase>; | ||
createAsset(recipe: AssetLedgerItemRecipe): Promise<MutationBase>; | ||
destroyAsset(assetId: string): Promise<MutationBase>; | ||
revokeAbilities(accountId: string, abilities: AssetLedgerAbility[]): Promise<MutationBase>; | ||
revokeAsset(assetId: string): Promise<MutationBase>; | ||
update(recipe: AssetLedgerUpdateRecipe): Promise<MutationBase>; | ||
updateAsset(assetId: string, recipe: AssetLedgerObjectUpdateRecipe): Promise<MutationBase>; | ||
transferAsset(recipe: AssetLedgerTransferRecipe): Promise<MutationBase>; | ||
enableTransfer(): Promise<MutationBase>; | ||
disableTransfer(): Promise<MutationBase>; | ||
updateAsset(assetId: string, recipe: AssetLedgerObjectUpdateRecipe): Promise<MutationBase>; | ||
update(recipe: AssetLedgerUpdateRecipe): Promise<MutationBase>; | ||
approveOperator(accountId: string): Promise<MutationBase>; | ||
disapproveOperator(accountId: string): Promise<MutationBase>; | ||
} | ||
/** | ||
* | ||
* Asset ledger deploy data definition. | ||
*/ | ||
@@ -67,3 +70,3 @@ export interface AssetLedgerDeployRecipe { | ||
/** | ||
* | ||
* Asset data definition. | ||
*/ | ||
@@ -77,3 +80,3 @@ export interface AssetLedgerItem { | ||
/** | ||
* | ||
* Asset ledger data definition. | ||
*/ | ||
@@ -89,3 +92,3 @@ export interface AssetLedgerInfo { | ||
/** | ||
* | ||
* Asset creation data definition. | ||
*/ | ||
@@ -99,3 +102,3 @@ export interface AssetLedgerItemRecipe { | ||
/** | ||
* | ||
* Asset transfer data definition. | ||
*/ | ||
@@ -109,3 +112,3 @@ export interface AssetLedgerTransferRecipe { | ||
/** | ||
* | ||
* Asset update data definition. | ||
*/ | ||
@@ -117,3 +120,3 @@ export interface AssetLedgerObjectUpdateRecipe { | ||
/** | ||
* | ||
* Asset ledger update data definition. | ||
*/ | ||
@@ -120,0 +123,0 @@ export interface AssetLedgerUpdateRecipe { |
@@ -1,7 +0,15 @@ | ||
import { Order } from "./order"; | ||
import { MutationBase } from "./misc"; | ||
import { MutationBase } from "./mutation"; | ||
/** | ||
* | ||
* List of available order action kinds. | ||
*/ | ||
export enum OrderActionKind { | ||
CREATE_ASSET = 1, | ||
TRANSFER_ASSET = 2, | ||
TRANSFER_VALUE = 3, | ||
} | ||
/** | ||
* Order gateway method definition. | ||
*/ | ||
export interface OrderGatewayBase { | ||
@@ -13,1 +21,52 @@ readonly id: string; | ||
} | ||
/** | ||
* | ||
*/ | ||
export type OrderAction = OrderActionCreateAsset | OrderActionTransferAsset | ||
| OrderActionTransferValue; | ||
/** | ||
* Order create asset data definitio. | ||
*/ | ||
export interface OrderActionCreateAsset { | ||
kind: OrderActionKind.CREATE_ASSET; | ||
ledgerId: string; | ||
senderId: string; | ||
receiverId: string; | ||
assetId: string; | ||
assetImprint: string; | ||
} | ||
/** | ||
* Order transfer asset data definition. | ||
*/ | ||
export interface OrderActionTransferAsset { | ||
kind: OrderActionKind.TRANSFER_ASSET; | ||
ledgerId: string; | ||
senderId: string; | ||
receiverId: string; | ||
assetId: string; | ||
} | ||
/** | ||
* Order transfer value data definition. | ||
*/ | ||
export interface OrderActionTransferValue { | ||
kind: OrderActionKind.TRANSFER_VALUE; | ||
ledgerId: string; | ||
senderId: string; | ||
receiverId: string; | ||
value: string; // TODO BN.js | ||
} | ||
/** | ||
* Order definition. | ||
*/ | ||
export class Order { | ||
public makerId: string; | ||
public takerId: string; | ||
public actions: OrderAction[]; | ||
public seed: number; | ||
public expiration: number; | ||
} |
@@ -12,27 +12,3 @@ /** | ||
export enum ProviderIssue { | ||
UNHANDLED = 0, | ||
GENERAL_REVERT = 1, | ||
SIGNATURE_UNKNOWN = 9000, | ||
SIGNATURE_FAILED = 9001, | ||
ZERO_ADDRESS = 1001, | ||
INVALID_NFT = 1002, | ||
NOT_AUTHORIZED = 1003, | ||
RECEIVER_DOES_NOT_SUPPORT_NFT = 1004, | ||
NFT_ALREADY_EXISTS = 1005, | ||
INVALID_INDEX = 1006, | ||
TRANSFERS_PAUSED = 1007, | ||
COIN_TRANSFER_FAILED = 1008, | ||
INVALID_SIGNATURE_KIND = 1009, | ||
INVALID_PROXY = 1010, | ||
YOU_ARE_NOT_THE_TAKER = 1011, | ||
SENDER_NOT_TAKER_OR_MAKER = 1012, | ||
ORDER_EXPIRED = 1013, | ||
INVALID_SIGNATURE = 1014, | ||
ORDER_CANCELED = 1015, | ||
ORDER_CANNOT_BE_PERFORMED_TWICE = 1016, | ||
YOU_ARE_NOT_THE_MAKER = 1017, | ||
SIGNER_NOT_AUTHORIZED = 1018, | ||
ONE_ZERO_ABILITY_HAS_TO_EXIST = 1019, | ||
TRANSATION_RESPONSE_ERROR_CHECK_PENDING_TRANSACTIONS = 2001, | ||
INVALID_ADDRESS = 2002, | ||
GENERAL = 0, | ||
} | ||
@@ -39,0 +15,0 @@ |
@@ -1,16 +0,20 @@ | ||
import { MutationBase } from "./misc"; | ||
import { MutationBase } from "./mutation"; | ||
import { OrderGatewayBase } from "./order-gateway"; | ||
/** | ||
* | ||
* Value ledger methods. | ||
*/ | ||
export interface ValueLedgerBase { | ||
readonly id: string; | ||
approveValue(value: string, accountId: string | OrderGatewayBase): Promise<MutationBase>; | ||
disapproveValue(accountId: string | OrderGatewayBase): Promise<MutationBase>; | ||
getApprovedValue(accountId: string, spenderId: string): Promise<String>; | ||
getBalance(accountId: string): Promise<string>; | ||
getInfo(): Promise<ValueLedgerInfo>; | ||
approveValue(accountId: string, value: string): Promise<MutationBase>; | ||
disapproveValue(accountId: string): Promise<MutationBase>; | ||
isApprovedValue(value: string, accountId: string | OrderGatewayBase, spenderId: string): Promise<Boolean>; | ||
transferValue(recipe: ValueLedgerTransferRecipe): Promise<MutationBase>; | ||
} | ||
/** | ||
* | ||
* Value ledger deploy data definition. | ||
*/ | ||
@@ -25,3 +29,3 @@ export interface ValueLedgerDeployRecipe { | ||
/** | ||
* | ||
* Value ledger information data definition. | ||
*/ | ||
@@ -36,3 +40,3 @@ export interface ValueLedgerInfo { | ||
/** | ||
* | ||
* Value transfer data definition. | ||
*/ | ||
@@ -39,0 +43,0 @@ export interface ValueLedgerTransferRecipe { |
export * from './assets/metadata'; | ||
export * from './core/provider'; | ||
export * from './core/asset-ledger'; | ||
export * from './core/misc'; | ||
export * from './core/mutation'; | ||
export * from './core/order-gateway'; | ||
export * from './core/order'; | ||
export * from './core/value-ledger'; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
Found 1 instance in 1 package
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
24737
1
1
1
8
0
37
607