Skip to content

Commit a89de3d

Browse files
authored
Merge pull request #21 from Kixo/branch_from_version_0_1_15
Version 0.1.16 - 2025-09-15 14:28:37
2 parents 5fb32a8 + 1f7fb88 commit a89de3d

6 files changed

Lines changed: 12 additions & 12 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "tailwind-plus-icpay",
3-
"version": "0.1.15",
3+
"version": "0.1.16",
44
"private": true,
55
"packageManager": "pnpm@9.12.3",
66
"scripts": {

src/app/errors/page.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ All SDK errors are `IcpayError` with a machine code and message.
1111
import { Icpay, IcpayError } from '@ic-pay/icpay-sdk'
1212

1313
try {
14-
await icpay.sendFunds({ symbol: 'ICP', amount: '1000' })
14+
await icpay.createPayment({ symbol: 'ICP', amount: '1000' })
1515
} catch (e) {
1616
if (e instanceof IcpayError) {
1717
if (e.isBalanceError()) {
@@ -27,7 +27,7 @@ try {
2727

2828
| Code | Category | Description | What to do |
2929
|---|---|---|---|
30-
| WALLET_NOT_CONNECTED | Wallet | A wallet/principal is required but not connected (e.g., before calling `sendFunds`). | Ask the user to connect their wallet; provide an `actorProvider` and `connectedWallet`.
30+
| WALLET_NOT_CONNECTED | Wallet | A wallet/principal is required but not connected (e.g., before calling `createPayment`). | Ask the user to connect their wallet; provide an `actorProvider` and `connectedWallet`.
3131
| WALLET_CONNECTION_FAILED | Wallet | Failed to connect to the selected wallet provider. | Offer retry or let the user pick another provider.
3232
| WALLET_DISCONNECTED | Wallet | Wallet was disconnected mid-flow. | Reconnect and restart the action.
3333
| WALLET_SIGNATURE_REJECTED | Wallet | User rejected the signature prompt. | Treat as user cancel; allow retry.

src/app/page.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Use the ICPay SDK to accept payments from users' wallets and manage your account
3232

3333
The ICPay SDK ships as a single package that supports two usage modes. Use the public SDK on the frontend with your Publishable Key; use the private SDK on the server with your Secret Key. {{ className: 'lead' }}
3434

35-
**Public SDK (frontend)**: Initialize with `publishableKey` for typical tasks like getting verified ledgers, resolving canister IDs, price calculation, and initiating payments from the user's wallet via `sendFunds`/`sendFundsUsd`.
35+
**Public SDK (frontend)**: Initialize with `publishableKey` for typical tasks like getting verified ledgers, resolving canister IDs, price calculation, and initiating payments from the user's wallet via `createPayment`/`createPaymentUsd`.
3636

3737
**Private SDK (server)**: Initialize with `secretKey` for account details, payment history, transactions, ledgers with prices for your account, webhook event lookups, and other server-side operations.
3838

src/app/sdk-overview/page.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ The ICPay SDK ships as a single package that supports two usage modes. Use the p
2424
## Public SDK (frontend)
2525

2626
- Initialize with `publishableKey`.
27-
- Typical tasks: get verified ledgers, resolve canister IDs, price calculation, and initiate payments from the user’s wallet via `sendFunds`/`sendFundsUsd` (requires wallet + actor provider).
27+
- Typical tasks: get verified ledgers, resolve canister IDs, price calculation, and initiate payments from the user’s wallet via `createPayment`/`createPaymentUsd` (requires wallet + actor provider).
2828
- See: [Public SDK guide](/sdk)
2929

3030
## Private SDK (server)

src/app/sdk/page.mdx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Create an account in the [icpay.org dashboard](/icpay-org) to obtain your Publis
3131

3232
## Quickstart
3333

34-
Initialize the SDK with your publishable key on the client. Only when using `sendFunds` or `sendFundsUsd`, you must provide an `actorProvider` and a connected wallet.
34+
Initialize the SDK with your publishable key on the client. Only when using `createPayment` or `createPaymentUsd`, you must provide an `actorProvider` and a connected wallet.
3535

3636
```ts {{ title: 'Client setup (TypeScript)' }}
3737
import { Icpay, IcpayError } from '@ic-pay/icpay-sdk'
@@ -40,7 +40,7 @@ const icpay = new Icpay({
4040
publishableKey: process.env.NEXT_PUBLIC_ICPAY_PK!,
4141

4242
// actorProvider + connected wallet are required only when calling
43-
// sendFunds or sendFundsUsd (e.g. Plug, Internet Identity, Oisy)
43+
// createPayment or createPaymentUsd (e.g. Plug, Internet Identity, Oisy)
4444
})
4545

4646
try {
@@ -65,14 +65,14 @@ const icpay = new Icpay({
6565
connectedWallet: { owner: '<principal-id>' },
6666
})
6767

68-
// We can send either symbol or ledgerCanisterId field to the sendFunds and sendFundsUsd (symbol is preferred)
68+
// We can send either symbol or ledgerCanisterId field to the createPayment and createPaymentUsd (symbol is preferred)
6969
const ledgers = await icpay.getVerifiedLedgers()
7070
const icpLedger = ledgers.find(l => l.symbol === 'ICP')!
7171
let ledgerCanisterId = icpLedger.canisterId
7272
// or
7373
// ledgerCanisterId = await icpay.getLedgerCanisterIdBySymbol('ICP')
7474

75-
const tx = await icpay.sendFunds({
75+
const tx = await icpay.createPayment({
7676
ledgerCanisterId, // ICP ledger or any ICRC ledger
7777
symbol: 'ICP', // Its either symbol or ledgerCanisterId (symbol is preferred)
7878
amount: '150000000', // smallest unit (e.g. 1.5 ICP with 8 decimals)
@@ -81,7 +81,7 @@ const tx = await icpay.sendFunds({
8181
```
8282

8383
```ts {{ title: 'Send by USD amount (auto conversion)' }}
84-
const res = await icpay.sendFundsUsd({
84+
const res = await icpay.createPaymentUsd({
8585
usdAmount: 5,
8686
ledgerCanisterId,
8787
symbol: 'ICP', // Its either symbol or ledgerCanisterId (symbol is preferred)
@@ -101,7 +101,7 @@ import { Icpay } from '@ic-pay/icpay-sdk'
101101
const icpay = new Icpay({ publishableKey: process.env.NEXT_PUBLIC_ICPAY_PK!, enableEvents: true })
102102

103103
// 1) Create intent for onramp (no wallet needed)
104-
const start = await icpay.sendFundsUsd({
104+
const start = await icpay.createPaymentUsd({
105105
usdAmount: 25,
106106
symbol: 'ICP',
107107
metadata: { context: 'onramp' },

src/app/widget/components/pay-button/page.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ Notes:
120120

121121
Enable card onramp from the wallet selector by configuring `onramp` and handle the success event. The component will:
122122

123-
- Create an onramp intent via the SDK (`sendFundsUsd` with `onrampPayment: true`).
123+
- Create an onramp intent via the SDK (`createPaymentUsd` with `onrampPayment: true`).
124124
- Open Transak using the returned `sessionId`.
125125
- Close the Transak modal on `TRANSAK_ORDER_SUCCESSFUL` and start notifying ICPay until completion.
126126

0 commit comments

Comments
 (0)