0.32.5 • Published 7 months ago

payspec-js v0.32.5

Weekly downloads
-
License
MIT
Repository
-
Last release
7 months ago

Payspec JS

This is a TypeScript library for interacting with the Payspec smart contract on the Ethereum blockchain.

Deterministic invoicing and payments for Web3


To use this library, you can install it via NPM:

npm install payspec-typescript-library

Usage

Here is an example of how to use the getPayspecInvoiceUUID function in JavaScript:

const payspec = require('payspec-typescript-library');

const invoiceData = {
  payspecContractAddress: '0x1234567890123456789012345678901234567890',
  description: 'Example Invoice',
  nonce: '1234567890123456',
  token: '0x0000000000000000000000000000000000000000',
  totalAmountDue: '1000000000000000000',
  payToArrayStringified: '["0x1111111111111111111111111111111111111111", "0x2222222222222222222222222222222222222222"]',
  amountsDueArrayStringified: '[500000000000000000, 500000000000000000]',
  expiresAt: 1648694400
};

const uuid = payspec.getPayspecInvoiceUUID(invoiceData);

console.log(uuid);

API

getPayspecInvoiceUUID(invoiceData: PayspecInvoice): string | undefined

Generates a Universally Unique Identifier (UUID) for a Payspec invoice.

invoiceData - An object containing the following properties:
    payspecContractAddress - The address of the Payspec contract on the Ethereum blockchain.
    description - A description of the invoice.
    nonce - A random number used to prevent replay attacks.
    token - The address of the token used to pay the invoice (or 0x0000000000000000000000000000000000000000 for Ether).
    totalAmountDue - The total amount due for the invoice, in Wei or token units.
    payToArrayStringified - A JSON stringified array of Ethereum addresses that will receive payment for the invoice.
    amountsDueArrayStringified - A JSON stringified array of amounts due to each payee, in Wei or token units.
    expiresAt - The timestamp (in seconds) after which the invoice will expire.

Returns a string containing the UUID for the invoice, or undefined if there was an error.

Contributing

If you find any bugs or have suggestions for how to improve this library, please open an issue or a pull request on GitHub.

Publishing

yarn build yarn publish

0.32.5

7 months ago

0.32.4

7 months ago

0.32.3

7 months ago

0.32.2

7 months ago

0.31.3

7 months ago

0.32.1

7 months ago

0.31.2

7 months ago

0.31.1

7 months ago

0.30.7

7 months ago

0.30.6

7 months ago

0.30.5

7 months ago

0.30.4

7 months ago

0.30.3

1 year ago

0.30.2

1 year ago

0.30.0

1 year ago

0.29.0

1 year ago

0.29.2

1 year ago

0.29.1

1 year ago

0.27.2

1 year ago

0.25.4

1 year ago

0.28.0

1 year ago

0.25.3

1 year ago

0.27.0

1 year ago

0.26.1

1 year ago

0.25.2

1 year ago

0.26.0

1 year ago

0.25.1

1 year ago

0.25.0

1 year ago

0.23.2

1 year ago

0.24.0

1 year ago

0.23.1

1 year ago

0.23.0

1 year ago

0.22.1

1 year ago

0.28.2

1 year ago

0.25.5

1 year ago

0.21.0

2 years ago

0.20.0

2 years ago

0.19.0

2 years ago

0.22.0

2 years ago

0.16.0

2 years ago

0.15.0

2 years ago

0.14.0

2 years ago

0.13.0

2 years ago

0.12.0

2 years ago

0.11.0

2 years ago

0.10.0

2 years ago