0.0.81 • Published 3 years ago

@waves/waves-rest v0.0.81

Weekly downloads
12
License
MIT
Repository
github
Last release
3 years ago

waves-transactions npm version

License Coverage badge gree

Using this library you can easily create and sign transactions for Waves blockchain. It also allows you to multi-sign existing transactions or create them without signature at all.

This library is a set of transaction constructing functions:

Check full documentation on GitHub Pages.

Transactions

The idea is really simple - you create transaction and sign it from a minimal set of required params. If you want to create Transfer transaction the minimum you need to provide is amount and recipient as defined in Transfer params:

const { transfer } = require('@waves/waves-transactions')
const seed = 'some example seed phrase'
const signedTranserTx = transfer({ 
  amount: 1,
  recipient: '3P6fVra21KmTfWHBdib45iYV6aFduh4WwC2',
  timestamp: 1536917842558, //Timestamp is optional but it was overrided, in case timestamp is not provided it will fallback to Date.now()

  //Every function from the list above has a set of required and optional params
  //senderPublicKey: 'Cq5itmx4wbYuogySAoUp58MimLLkQrFFLr1tpJy2BYp1', // By default it is derived from seed, 
  // but if you don't want to sign transaction you have to provide it
  //fee: 100000, //Fee is always optional, in case fee is not provided, it will be calculated for you
  //additionalFee: 400000, //If fee is not set, this value will be added to the auto calculated value
  //feeAssetId: undefined
}, seed)

Output will be a signed transfer transaction:

{
  id: '8NrUwgKRCMFbUbqXKQAHkGnspmWHEjKUSi5opEC6Havq',
  type: 4,
  version: 2,
  recipient: '3P6fVra21KmTfWHBdib45iYV6aFduh4WwC2',
  attachment: undefined,
  feeAssetId: undefined,
  assetId: undefined,
  amount: 1,
  fee: 100000,
  senderPublicKey: '6nR7CXVV7Zmt9ew11BsNzSvVmuyM5PF6VPbWHW9BHgPq',
  timestamp: 1536917842558,
  proofs: [
    '25kyX6HGjS3rkPTJRj5NVH6LLuZe6SzCzFtoJ8GDkojY9U5oPfVrnwBgrCHXZicfsmLthPUjTrfT9TQL2ciYrPGE'
  ]
}

Now you are able to POST it to Waves API or store for future purpose or you can add another signature from other party:

const otherPartySeed = 'other party seed phrase'
const transferSidnedWithTwoParties = transfer(signedTranserTx, seed)

So now there are two proofs:

{
  id: '8NrUwgKRCMFbUbqXKQAHkGnspmWHEjKUSi5opEC6Havq',
  type: 4,
  version: 2,
  recipient: '3P6fVra21KmTfWHBdib45iYV6aFduh4WwC2',
  attachment: undefined,
  feeAssetId: undefined,
  assetId: undefined,
  amount: 1,
  fee: 100000,
  senderPublicKey: '6nR7CXVV7Zmt9ew11BsNzSvVmuyM5PF6VPbWHW9BHgPq',
  timestamp: 1536917842558,
  proofs: [
    '25kyX6HGjS3rkPTJRj5NVH6LLuZe6SzCzFtoJ8GDkojY9U5oPfVrnwBgrCHXZicfsmLthPUjTrfT9TQL2ciYrPGE',
    'CM9emPzpe6Ram7ZxcYax6s7Hkw6698wXCMPSckveFAS2Yh9vqJpy1X9nL7p4RKgU3UEa8c9RGXfUK6mFFq4dL9z'
  ]
}
0.0.81

3 years ago

0.0.80

3 years ago

0.0.79

3 years ago

0.0.78

3 years ago

0.0.77

3 years ago

0.0.76

3 years ago

0.0.75

4 years ago

0.0.74

4 years ago

0.0.73

4 years ago

0.0.72

4 years ago

0.0.71

4 years ago

0.0.70

4 years ago

0.0.66

4 years ago

0.0.67

4 years ago

0.0.68

4 years ago

0.0.69

4 years ago

0.0.65

4 years ago

0.0.64

4 years ago

0.0.62

4 years ago

0.0.63

4 years ago

0.0.60

4 years ago

0.0.61

4 years ago

0.0.59

4 years ago

0.0.57

4 years ago

0.0.58

4 years ago

0.0.56

4 years ago

0.0.52

4 years ago

0.0.53

4 years ago

0.0.54

4 years ago

0.0.55

4 years ago

0.0.51

4 years ago

0.0.50

4 years ago

0.0.49

4 years ago

0.0.48

4 years ago

0.0.47

4 years ago

0.0.46

4 years ago

0.0.45

4 years ago

0.0.44

4 years ago

0.0.42

4 years ago

0.0.43

4 years ago

0.0.41

4 years ago

0.0.40

5 years ago

0.0.39

5 years ago

0.0.38

5 years ago

0.0.37

5 years ago

0.0.36

5 years ago

0.0.35

5 years ago

0.0.34

5 years ago

0.0.33

5 years ago

0.0.32

5 years ago

0.0.31

5 years ago

0.0.30

5 years ago

0.0.29

5 years ago

0.0.28

5 years ago

0.0.27

5 years ago

0.0.26

5 years ago

0.0.25

5 years ago

0.0.24

5 years ago

0.0.23

5 years ago

0.0.22

5 years ago

0.0.21

5 years ago

0.0.20

5 years ago

0.0.19

5 years ago

0.0.18

5 years ago

0.0.17

5 years ago

0.0.16

5 years ago

0.0.15

5 years ago

0.0.14

5 years ago

0.0.13

5 years ago

0.0.12

5 years ago

0.0.11

5 years ago

0.0.10

5 years ago

0.0.9

5 years ago

0.0.8

5 years ago

0.0.7

5 years ago

0.0.6

5 years ago

0.0.5

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago