1.1.77 • Published 3 years ago

aftr-market v1.1.77

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

AFTR is a protocol that groups or encapsulates assets in the Arweave ecosystem. The first use case is called AFTR.Market which presets treasury management and governance for Arweave assets.

// When you update the repository(code), make sure you build it so that it's ready for the run

npm run build

// When you publish your code make sure your version(in package,json) always updated. and after that use followig command to pulish your library.

npm publish

Installation Package Command

npm install aftr-market

js

Library to interact with AFTR Market

Initialization

import Aftr from "aftr-market";

const client = new Aftr();

Usage

The library supports data requests and interactions with the protocol:

Create Vehicle

// example usage to access the create vehicle function await client.vehicle.createVehicle(...);

Adding a new vehicle.

await client.vehicle.createVehicle(vehicleObject, wallet, options)

The function takes three params:

  • vehicleObject: json object that defines the vehicle (the object should follow the state interface in the faces.ts file)
  • wallet: Optional. In order to create the contract (this is a keyfile object or the “use_wallet” string if the developer is using this in a browser with Arconnect).
  • options - optional object that defines optional parameters such as testnet.
    • Parameters - If the options object is specified, then the createVehicle method will use these values as opposed to the hardcoded values in the code.
      • aftrSourceContractId: string
      • aftrProtocolTag: string (the Protocol tag is hardcoded for production as “AFTR”) - The protocol tag is always required, so if it’s not specified in the options object, it is hardcoded in the code.
      • customTags: array of {name: “”, value: “”} - this gives the user the opportunity to add custom tags
      • Example options object:

        {
        	aftrSourceContractId: <string>,  // Allows user to add a contract Id for test purposes. If no value is supplied, then the hardcoded value is used.
        	aftrProtocolTag: "AFTR-BETA",    // Allows user to customize Protocol tag. If no value provided, "AFTR" is hardcoded.
        	customTags: [
        		{ "<CUSTOM_NAME>": "<CUSTOM_VALUE>" }, // Allows user to add tags
        	]
        }

The function returns the created vehicle ID.

Edit Vehicle

Edit the existing vehicle.

await client.vehicle.editVehicle(wallet, vehicleId, [{"name" : "test-2"}, {"ticker" : "CHILL-1"}])

The function takes three params:

  • wallet: Optional. In order to create the contract (this is a keyfile object or the “use_wallet” string if the developer is using this in a browser with Arconnect).
  • vehicleId - Contract ID of the vehicle to be edited
  • changeMap(Array of object) - map of items to be changed
1.1.77

3 years ago

1.1.76

3 years ago

1.1.75

3 years ago

1.1.74

3 years ago

1.1.73

3 years ago

1.1.72

3 years ago

1.1.71

3 years ago

1.1.70

3 years ago

1.1.69

3 years ago

1.1.68

3 years ago

1.1.67

3 years ago

1.1.66

3 years ago

1.1.65

3 years ago

1.1.64

3 years ago

1.1.63

3 years ago

1.1.62

3 years ago

1.1.61

3 years ago

1.1.60

3 years ago

1.1.59

3 years ago

1.1.58

3 years ago

1.1.57

3 years ago

1.1.56

3 years ago

1.1.55

3 years ago

1.1.54

3 years ago

1.1.53

3 years ago

1.1.52

3 years ago

1.1.51

3 years ago

1.1.50

3 years ago

1.1.49

3 years ago

1.1.48

3 years ago

1.1.47

3 years ago

1.1.46

3 years ago

1.1.45

3 years ago

1.1.44

3 years ago

1.1.43

3 years ago

1.1.42

3 years ago

1.1.41

3 years ago

1.1.40

3 years ago

1.1.39

3 years ago

1.1.38

3 years ago

1.1.37

3 years ago

1.1.36

3 years ago

1.1.35

3 years ago

1.1.34

3 years ago

1.1.33

3 years ago

1.1.32

3 years ago

1.1.31

3 years ago

1.1.30

3 years ago

1.1.29

3 years ago

1.1.28

3 years ago

1.1.27

3 years ago

1.1.26

3 years ago

1.1.25

3 years ago

1.1.24

3 years ago

1.1.23

3 years ago

1.1.22

3 years ago

1.1.21

3 years ago

1.1.20

3 years ago

1.1.19

3 years ago

1.1.18

3 years ago

1.1.17

3 years ago

1.1.16

3 years ago

1.1.15

3 years ago

1.1.14

3 years ago

1.1.13

3 years ago

1.1.12

3 years ago

1.1.11

3 years ago

1.1.10

3 years ago

1.1.9

3 years ago

1.1.8

3 years ago

1.1.7

3 years ago

1.1.6

3 years ago

1.1.5

3 years ago

1.1.4

3 years ago

1.1.3

3 years ago

1.1.2

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.0

3 years ago