Wander Docs
HomeGithub
  • ๐Ÿ‘‹Welcome to Wander
  • โ›๏ธDeveloper tooling
    • Wander Devtools
    • ArLocal Devtools
  • ๐Ÿ“šExternal libraries
    • Arweave Wallet Kit
    • arweave-js
  • ๐Ÿ”ญDemos
    • Applications
  • ๐ŸงชAPI
    • Intro
    • Events
    • Connect
    • Disconnect
    • Get active address
    • Get active public key
    • Get all addresses
    • Get wallet names
    • Sign Transaction
    • Dispatch Transaction
    • Sign DataItem
    • Batch Sign DataItem
    • Sign message
    • Verify message
    • Private hash
    • User Tokens
    • Token Balance
    • Encrypt
    • Decrypt
    • Crypto signature
    • Subscriptions
    • Retrive permissions
    • Retrive Gateway Config
  • ๐ŸŒWander.app
Powered by GitBook
On this page
  • Recurring Payment Frequency
  • Example usage

Was this helpful?

Edit on GitHub
  1. API

Subscriptions

Wander Injected API subscription() function

PreviousCrypto signatureNextRetrive permissions

Last updated 3 months ago

Was this helpful?

Subscriptions is a feature that allows users to subscribe to applications and be charged on a periodic basis such as monthly, weekly, or quarterly. Users will be charged the moment they subscribe

Argument
Type
Description

arweaveAccountAddress

string

The account address where payments will be made

applicationName

string

The name of your application

subscriptionName

string

The name of the subscription

subscriptionManagementUrl

string

A URL where users are able to manage their subscriptions

subscriptionFeeAmount

number

The amount in AR to be paid each period

recurringPaymentFrequency

Frequency for period to be charged

subscriptionEndDate

Date

When the subscription ends

applicationIcon

string

URL where an image is hosted, ideally 48x48

Note: This function requires the permission.

Recurring Payment Frequency

This function requires a recurring frequency such as listed:

Recurring Payment Frequency

export enum RecurringPaymentFrequency {
  QUARTERLY = "Quarterly",
  MONTHLY = "Monthly",
  WEEKLY = "Weekly",
  DAILY = "Daily",
}

Example usage

Wander was formerly know as ArConnect. There are some API references that still use ArConnect

// connect to the extension
await window.arweaveWallet.connect(["ACCESS_ALL_ADDRESSES"]);

// submit the subscription information
const subscription = await window.arweaveWallet.subscription({
  arweaveAccountAddress: "hY70z-mbKfDByqXh4y43ybSxReFVo1i9lB1dDdCkO_U",
  applicationName: "Wander",
  subscriptionName: "Wander Premium",
  subscriptionManagementUrl: "https://wander.app/premium",
  subscriptionFeeAmount: 0.5,
  recurringPaymentFrequency: "Monthly",
  subscriptionEndDate: new Date("2024-12-31"),
  applicationIcon: "https://wander.app/logo",
});

// Subscription will output the details and the initial payment txn
console.log("Subscription details with paymentHistory array:", subscription);

๐Ÿงช
RecurringPaymentFrequency
ACCESS_ALL_ADDRESSES