1.1.77 • Published 2 years ago

aftr-market v1.1.77

Weekly downloads
-
License
ISC
Repository
github
Last release
2 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

2 years ago

1.1.76

2 years ago

1.1.75

2 years ago

1.1.74

2 years ago

1.1.73

2 years ago

1.1.72

2 years ago

1.1.71

2 years ago

1.1.70

2 years ago

1.1.69

2 years ago

1.1.68

2 years ago

1.1.67

2 years ago

1.1.66

2 years ago

1.1.65

2 years ago

1.1.64

2 years ago

1.1.63

2 years ago

1.1.62

2 years ago

1.1.61

2 years ago

1.1.60

2 years ago

1.1.59

2 years ago

1.1.58

2 years ago

1.1.57

2 years ago

1.1.56

2 years ago

1.1.55

2 years ago

1.1.54

2 years ago

1.1.53

2 years ago

1.1.52

2 years ago

1.1.51

2 years ago

1.1.50

2 years ago

1.1.49

2 years ago

1.1.48

2 years ago

1.1.47

2 years ago

1.1.46

2 years ago

1.1.45

2 years ago

1.1.44

2 years ago

1.1.43

2 years ago

1.1.42

2 years ago

1.1.41

2 years ago

1.1.40

2 years ago

1.1.39

2 years ago

1.1.38

2 years ago

1.1.37

2 years ago

1.1.36

2 years ago

1.1.35

2 years ago

1.1.34

2 years ago

1.1.33

2 years ago

1.1.32

2 years ago

1.1.31

2 years ago

1.1.30

2 years ago

1.1.29

2 years ago

1.1.28

2 years ago

1.1.27

2 years ago

1.1.26

2 years ago

1.1.25

2 years ago

1.1.24

2 years ago

1.1.23

2 years ago

1.1.22

2 years ago

1.1.21

2 years ago

1.1.20

2 years ago

1.1.19

2 years ago

1.1.18

2 years ago

1.1.17

2 years ago

1.1.16

2 years ago

1.1.15

2 years ago

1.1.14

2 years ago

1.1.13

2 years ago

1.1.12

2 years ago

1.1.11

2 years ago

1.1.10

2 years ago

1.1.9

2 years ago

1.1.8

2 years ago

1.1.7

2 years ago

1.1.6

2 years ago

1.1.5

2 years ago

1.1.4

2 years ago

1.1.3

2 years ago

1.1.2

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

1.0.0

2 years ago