@0xcert/scaffold
Advanced tools
Comparing version 0.0.0-alpha1 to 0.0.0-alpha10
@@ -5,4 +5,4 @@ { | ||
{ | ||
"version": "0.0.0-alpha1", | ||
"tag": "@0xcert/scaffold_v0.0.0-alpha1", | ||
"version": "0.0.0-alpha10", | ||
"tag": "@0xcert/scaffold_v0.0.0-alpha10", | ||
"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-alpha1 | ||
## 0.0.0-alpha10 | ||
Thu, 22 Nov 2018 00:51:03 GMT | ||
@@ -8,0 +8,0 @@ |
@@ -1,36 +0,80 @@ | ||
import { Query, Mutation } from "./context"; | ||
import { MutationBase } from "./mutation"; | ||
import { OrderGatewayBase } from "./order-gateway"; | ||
export declare enum AssetLedgerAbility { | ||
MANAGE_ABILITIES = 0, | ||
MINT_ASSET = 1, | ||
REVOKE_ASSET = 2, | ||
PAUSE_TRANSFER = 3, | ||
UPDATE_PROOF = 4, | ||
SIGN_MINT_CLAIM = 5 | ||
MANAGE_ABILITIES = 1, | ||
CREATE_ASSET = 2, | ||
REVOKE_ASSET = 4, | ||
TOGGLE_TRANSFERS = 8, | ||
UPDATE_ASSET = 16, | ||
ALLOW_CREATE_ASSET = 32, | ||
UPDATE_URI_BASE = 64 | ||
} | ||
export declare enum AssetLedgerTransferState { | ||
DISABLED = 0, | ||
ENABLED = 1 | ||
} | ||
export declare enum AssetLedgerCapability { | ||
BURNABLE = 1, | ||
MUTABLE = 2, | ||
PAUSABLE = 3, | ||
REVOKABLE = 4 | ||
DESTROY_ASSET = 1, | ||
UPDATE_ASSET = 2, | ||
REVOKE_ASSET = 4, | ||
TOGGLE_TRANSFERS = 3 | ||
} | ||
export interface AssetLedgerBase { | ||
readonly id: string; | ||
getAbilities(accountId: string): Promise<Query<AssetLedgerAbility[]>>; | ||
getCapabilities(): Promise<Query<AssetLedgerCapability[]>>; | ||
getInfo(): Promise<Query<AssetLedgerGetInfoResult>>; | ||
getSupply(): Promise<Query<number>>; | ||
getTransferState(): Promise<Query<AssetLedgerTransferState>>; | ||
assignAbilities(accountId: string, abilities: AssetLedgerAbility[]): any; | ||
revokeAbilities(accountId: string, abilities: AssetLedgerAbility[]): any; | ||
setTransferState(state: AssetLedgerTransferState): Promise<Mutation>; | ||
approveAccount(assetId: string, accountId: string | OrderGatewayBase): Promise<MutationBase>; | ||
approveOperator(accountId: string | OrderGatewayBase): Promise<MutationBase>; | ||
grantAbilities(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>; | ||
getBalance(accountId: string): Promise<string>; | ||
getCapabilities(): Promise<AssetLedgerCapability[]>; | ||
getInfo(): Promise<AssetLedgerInfo>; | ||
isApprovedAccount(assetId: string, accountId: string | OrderGatewayBase): Promise<boolean>; | ||
isApprovedOperator(accountId: string, operatorId: string | OrderGatewayBase): Promise<boolean>; | ||
isTransferable(): Promise<boolean>; | ||
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>; | ||
} | ||
export interface AssetLedgerGetInfoResult { | ||
export interface AssetLedgerDeployRecipe { | ||
name: string; | ||
symbol: string; | ||
uriBase: string; | ||
conventionId: string; | ||
schemaId: string; | ||
capabilities?: AssetLedgerCapability[]; | ||
} | ||
export interface AssetLedgerItem { | ||
id: string; | ||
uri: string; | ||
imprint: string; | ||
} | ||
export interface AssetLedgerInfo { | ||
name: string; | ||
symbol: string; | ||
uriBase: string; | ||
schemaId: string; | ||
supply: string; | ||
} | ||
export interface AssetLedgerItemRecipe { | ||
receiverId: string; | ||
id: string; | ||
imprint: string; | ||
} | ||
export interface AssetLedgerTransferRecipe { | ||
senderId?: string; | ||
receiverId: string; | ||
id: string; | ||
data?: string; | ||
} | ||
export interface AssetLedgerObjectUpdateRecipe { | ||
imprint: string; | ||
} | ||
export interface AssetLedgerUpdateRecipe { | ||
uriBase: string; | ||
} |
@@ -5,21 +5,17 @@ "use strict"; | ||
(function (AssetLedgerAbility) { | ||
AssetLedgerAbility[AssetLedgerAbility["MANAGE_ABILITIES"] = 0] = "MANAGE_ABILITIES"; | ||
AssetLedgerAbility[AssetLedgerAbility["MINT_ASSET"] = 1] = "MINT_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["MANAGE_ABILITIES"] = 1] = "MANAGE_ABILITIES"; | ||
AssetLedgerAbility[AssetLedgerAbility["CREATE_ASSET"] = 2] = "CREATE_ASSET"; | ||
AssetLedgerAbility[AssetLedgerAbility["REVOKE_ASSET"] = 4] = "REVOKE_ASSET"; | ||
AssetLedgerAbility[AssetLedgerAbility["TOGGLE_TRANSFERS"] = 8] = "TOGGLE_TRANSFERS"; | ||
AssetLedgerAbility[AssetLedgerAbility["UPDATE_ASSET"] = 16] = "UPDATE_ASSET"; | ||
AssetLedgerAbility[AssetLedgerAbility["ALLOW_CREATE_ASSET"] = 32] = "ALLOW_CREATE_ASSET"; | ||
AssetLedgerAbility[AssetLedgerAbility["UPDATE_URI_BASE"] = 64] = "UPDATE_URI_BASE"; | ||
})(AssetLedgerAbility = exports.AssetLedgerAbility || (exports.AssetLedgerAbility = {})); | ||
var AssetLedgerTransferState; | ||
(function (AssetLedgerTransferState) { | ||
AssetLedgerTransferState[AssetLedgerTransferState["DISABLED"] = 0] = "DISABLED"; | ||
AssetLedgerTransferState[AssetLedgerTransferState["ENABLED"] = 1] = "ENABLED"; | ||
})(AssetLedgerTransferState = exports.AssetLedgerTransferState || (exports.AssetLedgerTransferState = {})); | ||
var AssetLedgerCapability; | ||
(function (AssetLedgerCapability) { | ||
AssetLedgerCapability[AssetLedgerCapability["BURNABLE"] = 1] = "BURNABLE"; | ||
AssetLedgerCapability[AssetLedgerCapability["MUTABLE"] = 2] = "MUTABLE"; | ||
AssetLedgerCapability[AssetLedgerCapability["PAUSABLE"] = 3] = "PAUSABLE"; | ||
AssetLedgerCapability[AssetLedgerCapability["REVOKABLE"] = 4] = "REVOKABLE"; | ||
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,11 +0,29 @@ | ||
import { Query } from "./context"; | ||
import { MutationBase } from "./mutation"; | ||
import { OrderGatewayBase } from "./order-gateway"; | ||
export interface ValueLedgerBase { | ||
readonly id: string; | ||
getInfo(): Promise<Query<ValueLedgerGetInfoResult>>; | ||
getSupply(): Promise<Query<number>>; | ||
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>; | ||
isApprovedValue(value: string, accountId: string | OrderGatewayBase, spenderId: string): Promise<Boolean>; | ||
transferValue(recipe: ValueLedgerTransferRecipe): Promise<MutationBase>; | ||
} | ||
export interface ValueLedgerGetInfoResult { | ||
export interface ValueLedgerDeployRecipe { | ||
name: string; | ||
symbol: string; | ||
decimals: string; | ||
supply: string; | ||
} | ||
export interface ValueLedgerInfo { | ||
name: string; | ||
symbol: string; | ||
decimals: number; | ||
supply: string; | ||
} | ||
export interface ValueLedgerTransferRecipe { | ||
senderId?: string; | ||
receiverId: string; | ||
value: string; | ||
} |
export * from './assets/metadata'; | ||
export * from './core/connector'; | ||
export * from './core/provider'; | ||
export * from './core/asset-ledger'; | ||
export * from './core/context'; | ||
export * from './core/errors'; | ||
export * from './core/order-exchange'; | ||
export * from './core/order'; | ||
export * from './core/mutation'; | ||
export * from './core/order-gateway'; | ||
export * from './core/value-ledger'; |
@@ -6,5 +6,6 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
__export(require("./core/provider")); | ||
__export(require("./core/asset-ledger")); | ||
__export(require("./core/errors")); | ||
__export(require("./core/order")); | ||
__export(require("./core/mutation")); | ||
__export(require("./core/order-gateway")); | ||
//# sourceMappingURL=index.js.map |
{ | ||
"files": {}, | ||
"arguments": "npx hayspec test " | ||
"arguments": "npm run clean && npx tsc " | ||
} |
{ | ||
"name": "@0xcert/scaffold", | ||
"version": "0.0.0-alpha1", | ||
"description": "0xcert protocol scaffold.", | ||
"version": "0.0.0-alpha10", | ||
"description": "Overarching module with types, enums, and interfaces for easier development of interoperable modules.", | ||
"main": "./dist/index.js", | ||
"types": "./dist/index.d.ts", | ||
"scripts": { | ||
"build": "npx tsc", | ||
"test": "npx hayspec test" | ||
"clean": "rm -Rf ./dist", | ||
"build": "npm run clean && npx tsc", | ||
"test": "npx nyc npx hayspec test" | ||
}, | ||
@@ -19,7 +20,52 @@ "hayspec": { | ||
}, | ||
"nyc": { | ||
"extension": [ | ||
".ts" | ||
], | ||
"require": [ | ||
"ts-node/register" | ||
], | ||
"exclude": [ | ||
"src/tests" | ||
] | ||
}, | ||
"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", | ||
"@types/node": "^10.12.0", | ||
"@hayspec/cli": "^0.8.3", | ||
"@hayspec/spec": "^0.8.3", | ||
"@types/node": "^10.12.10", | ||
"nyc": "^13.1.0", | ||
"ts-node": "^7.0.1", | ||
@@ -26,0 +72,0 @@ "typescript": "^3.1.1" |
/** | ||
* | ||
* Definition of asset metadata. | ||
*/ | ||
@@ -4,0 +4,0 @@ export interface AssetMetadata { |
@@ -1,56 +0,120 @@ | ||
import { Query, Mutation, ContextBase } from "./context"; | ||
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, | ||
REVOKE_ASSET = 2, | ||
PAUSE_TRANSFER = 3, | ||
UPDATE_PROOF = 4, | ||
SIGN_MINT_CLAIM = 5, | ||
MANAGE_ABILITIES = 1, | ||
CREATE_ASSET = 2, | ||
REVOKE_ASSET = 4, | ||
TOGGLE_TRANSFERS = 8, | ||
UPDATE_ASSET = 16, | ||
ALLOW_CREATE_ASSET = 32, | ||
UPDATE_URI_BASE = 64, | ||
} | ||
/** | ||
* | ||
* List of available asset ledger capabilities. | ||
*/ | ||
export enum AssetLedgerTransferState { | ||
DISABLED = 0, | ||
ENABLED = 1, | ||
export enum AssetLedgerCapability { | ||
DESTROY_ASSET = 1, | ||
UPDATE_ASSET = 2, | ||
REVOKE_ASSET = 4, | ||
TOGGLE_TRANSFERS = 3, | ||
} | ||
/** | ||
* | ||
* Asset ledger method definitions. | ||
*/ | ||
export enum AssetLedgerCapability { | ||
BURNABLE = 1, | ||
MUTABLE = 2, | ||
PAUSABLE = 3, | ||
REVOKABLE = 4, | ||
export interface AssetLedgerBase { | ||
readonly id: string; | ||
approveAccount(assetId: string, accountId: string | OrderGatewayBase): Promise<MutationBase>; | ||
approveOperator(accountId: string | OrderGatewayBase): Promise<MutationBase>; | ||
grantAbilities(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>; | ||
getBalance(accountId: string): Promise<string>; | ||
getCapabilities(): Promise<AssetLedgerCapability[]>; | ||
getInfo(): Promise<AssetLedgerInfo>; | ||
isApprovedAccount(assetId: string, accountId: string | OrderGatewayBase): Promise<boolean>; | ||
isApprovedOperator(accountId: string, operatorId: string | OrderGatewayBase): Promise<boolean>; | ||
isTransferable(): Promise<boolean>; | ||
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>; | ||
} | ||
/** | ||
* | ||
* Asset ledger deploy data definition. | ||
*/ | ||
export interface AssetLedgerBase { | ||
readonly id: string; | ||
getAbilities(accountId: string): Promise<Query<AssetLedgerAbility[]>>; | ||
getCapabilities(): Promise<Query<AssetLedgerCapability[]>>; | ||
getInfo(): Promise<Query<AssetLedgerGetInfoResult>>; | ||
getSupply(): Promise<Query<number>>; | ||
getTransferState(): Promise<Query<AssetLedgerTransferState>>; | ||
assignAbilities(accountId: string, abilities: AssetLedgerAbility[]); | ||
revokeAbilities(accountId: string, abilities: AssetLedgerAbility[]); | ||
setTransferState(state: AssetLedgerTransferState): Promise<Mutation>; | ||
export interface AssetLedgerDeployRecipe { | ||
name: string; | ||
symbol: string; | ||
uriBase: string; | ||
schemaId: string; | ||
capabilities?: AssetLedgerCapability[]; | ||
} | ||
/** | ||
* | ||
* Asset data definition. | ||
*/ | ||
export interface AssetLedgerGetInfoResult { | ||
export interface AssetLedgerItem { | ||
id: string; | ||
uri: string; | ||
imprint: string; | ||
} | ||
/** | ||
* Asset ledger data definition. | ||
*/ | ||
export interface AssetLedgerInfo { | ||
name: string; | ||
symbol: string; | ||
uriBase: string; | ||
conventionId: string | ||
schemaId: string; | ||
supply: string; | ||
} | ||
/** | ||
* Asset creation data definition. | ||
*/ | ||
export interface AssetLedgerItemRecipe { | ||
receiverId: string; | ||
id: string; | ||
imprint: string; | ||
} | ||
/** | ||
* Asset transfer data definition. | ||
*/ | ||
export interface AssetLedgerTransferRecipe { | ||
senderId?: string; | ||
receiverId: string; | ||
id: string; | ||
data?: string; | ||
} | ||
/** | ||
* Asset update data definition. | ||
*/ | ||
export interface AssetLedgerObjectUpdateRecipe { | ||
imprint: string; | ||
} | ||
/** | ||
* Asset ledger update data definition. | ||
*/ | ||
export interface AssetLedgerUpdateRecipe { | ||
uriBase: string; | ||
} |
@@ -1,19 +0,46 @@ | ||
import { Query, ContextBase } from "./context"; | ||
import { MutationBase } from "./mutation"; | ||
import { OrderGatewayBase } from "./order-gateway"; | ||
/** | ||
* | ||
* Value ledger methods. | ||
*/ | ||
export interface ValueLedgerBase { | ||
readonly id: string; | ||
getInfo(): Promise<Query<ValueLedgerGetInfoResult>>; | ||
getSupply(): Promise<Query<number>>; | ||
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>; | ||
isApprovedValue(value: string, accountId: string | OrderGatewayBase, spenderId: string): Promise<Boolean>; | ||
transferValue(recipe: ValueLedgerTransferRecipe): Promise<MutationBase>; | ||
} | ||
/** | ||
* | ||
* Value ledger deploy data definition. | ||
*/ | ||
export interface ValueLedgerGetInfoResult { | ||
export interface ValueLedgerDeployRecipe { | ||
name: string; | ||
symbol: string; | ||
decimals: string; | ||
supply: string; | ||
} | ||
/** | ||
* Value ledger information data definition. | ||
*/ | ||
export interface ValueLedgerInfo { | ||
name: string; | ||
symbol: string; | ||
decimals: number; | ||
supply: string; | ||
} | ||
/** | ||
* Value transfer data definition. | ||
*/ | ||
export interface ValueLedgerTransferRecipe { | ||
senderId?: string; | ||
receiverId: string; | ||
value: string; | ||
} | ||
export * from './assets/metadata'; | ||
export * from './core/connector'; | ||
export * from './core/provider'; | ||
export * from './core/asset-ledger'; | ||
export * from './core/context'; | ||
export * from './core/errors'; | ||
export * from './core/order-exchange'; | ||
export * from './core/order'; | ||
export * from './core/mutation'; | ||
export * from './core/order-gateway'; | ||
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
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
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
1
1
1
8
0
23709
6
38
593
1