This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.google.gson.internal.LinkedTreeMap; | |
import org.arkecosystem.client.Connection; | |
import org.arkecosystem.crypto.configuration.Network; | |
import org.arkecosystem.crypto.networks.Devnet; | |
import org.arkecosystem.crypto.transactions.builder.MultiPaymentBuilder; | |
import org.arkecosystem.crypto.transactions.types.Transaction; | |
import java.io.IOException; | |
import java.util.ArrayList; | |
import java.util.HashMap; | |
/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {Transactions , Managers, Utils} from "@arkecosystem/crypto"; | |
import * as request from "request"; | |
/** | |
* Simple example of a transfer transaction using | |
* @arkecosystem/crypto https://github.com/ArkEcosystem/core/tree/develop/packages/crypto | |
* | |
**/ | |
Managers.configManager.setHeight(4006000); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Leave the gun. Take the cannoli. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const businessRegistrationType: number = MarketplaceTransactionTypes.BusinessRegistration; | |
export class BusinessRegistrationBuilder extends Transactions.TransactionBuilder<BusinessRegistrationBuilder> { | |
constructor() { | |
super(); | |
this.data.asset = { businessRegistration: {} }; | |
} | |
public businessRegistrationAsset(businessAsset: IBusinessRegistrationAsset): BusinessRegistrationBuilder { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export class BusinessRegistrationTransaction extends Transactions.Transaction { | |
public static typeGroup = 1; | |
public static type = BUSINESS_REGISTRATION_TYPE; | |
public static key: string = "businessRegistration"; | |
protected static defaultStaticFee: Utils.BigNumber = Utils.BigNumber.make("5000000000"); | |
// ... | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// builder usage | |
const builder = new BusinessRegistrationBuilder(); | |
const businessRegistrationTransaction = builder | |
.nonce("3") | |
.businessRegistrationAsset({ | |
name: "businessName", | |
website: "www.website.com", | |
}) | |
.sign("clay harbor enemy utility margin pretty hub comic piece aerobic umbrella acquire"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export class BusinessRegistrationTransaction extends Transactions.Transaction { | |
public static getSchema(): Transactions.schemas.TransactionSchema { | |
return schemas.extend(schemas.transactionBaseSchema, { | |
$id: "businessRegistration", | |
required: ["asset"], | |
properties: { | |
type: { transactionType: businessRegistrationType }, | |
amount: { bignumber: { minimum: 0, maximum: 0 } }, | |
asset: { | |
type: "object", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export class BusinessRegistrationTransaction extends Transactions.Transaction { | |
public serialize(): ByteBuffer { | |
const { data } = this; | |
const businessRegistrationAsset = data.asset.businessRegistration as IBusinessRegistrationAsset; | |
// TODO Implement serialization (asset -> ByteBuffer) | |
return buffer; | |
} | |
public deserialize(buf: ByteBuffer): void { | |
const { data } = this; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export interface IBusinessRegistrationAsset { | |
name: string; | |
website: string; | |
vat?: string; | |
organizationRepository?: string; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Container } from "@arkecosystem/core-interfaces"; | |
import { LogManager } from "@arkecosystem/core-logger"; | |
import { defaults } from "./defaults"; | |
import { PinoLogger } from "./driver"; | |
export const plugin: Container.PluginDescriptor = { | |
pkg: require("../package.json"), | |
defaults, | |
alias: "logger", | |
extends: "@arkecosystem/core-logger", |
NewerOlder