Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@icpay/sdk",
"version": "1.3.54",
"version": "1.3.55",
"description": "Official icpay SDK for Internet Computer payments",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ type Account = record {
icp_account_identifier : opt text;
platform_fee_fixed : opt nat;
is_active : bool;
splits : vec SplitRule;
};
type AccountRecord = record { account_canister_id : nat64; account : Account };
type CanisterMetrics = record {
Expand Down Expand Up @@ -101,21 +102,28 @@ type Result_1 = variant { Ok : NotifyResult; Err : text };
type Result_2 = variant { Ok : Payout; Err : text };
type Result_3 = variant { Ok : nat; Err : text };
type Result_4 = variant { Ok : text; Err : text };
type Split = record {
account_canister_id : nat64;
index_block : opt nat64;
timestamp : opt nat64;
amount : nat;
};
type SplitRule = record { account_canister_id : nat64; percentage : nat16 };
type Transaction = record {
id : nat;
status : TransactionStatus;
account_canister_id : nat64;
platform_fee_amount : nat;
transfer_fee : nat;
memo : opt blob;
index_to_account : opt nat64;
timestamp_to_account : opt nat64;
notify_processing : bool;
timestamp : nat64;
index_received : opt nat64;
sender_principal_id : text;
account_amount : nat;
ledger_canister_id : text;
splits : vec Split;
timestamp_received : opt nat64;
amount : nat;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export interface Account {
'icp_account_identifier' : [] | [string],
'platform_fee_fixed' : [] | [bigint],
'is_active' : boolean,
'splits' : Array<SplitRule>,
}
export interface AccountRecord {
'account_canister_id' : bigint,
Expand Down Expand Up @@ -117,21 +118,31 @@ export type Result_3 = { 'Ok' : bigint } |
{ 'Err' : string };
export type Result_4 = { 'Ok' : string } |
{ 'Err' : string };
export interface Split {
'account_canister_id' : bigint,
'index_block' : [] | [bigint],
'timestamp' : [] | [bigint],
'amount' : bigint,
}
export interface SplitRule {
'account_canister_id' : bigint,
'percentage' : number,
}
export interface Transaction {
'id' : bigint,
'status' : TransactionStatus,
'account_canister_id' : bigint,
'platform_fee_amount' : bigint,
'transfer_fee' : bigint,
'memo' : [] | [Uint8Array | number[]],
'index_to_account' : [] | [bigint],
'timestamp_to_account' : [] | [bigint],
'notify_processing' : boolean,
'timestamp' : bigint,
'index_received' : [] | [bigint],
'sender_principal_id' : string,
'account_amount' : bigint,
'ledger_canister_id' : string,
'splits' : Array<Split>,
'timestamp_received' : [] | [bigint],
'amount' : bigint,
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
export const idlFactory = ({ IDL }) => {
const SplitRule = IDL.Record({
'account_canister_id' : IDL.Nat64,
'percentage' : IDL.Nat16,
});
const Account = IDL.Record({
'account_canister_id' : IDL.Nat64,
'platform_fee_percentage' : IDL.Nat16,
Expand All @@ -7,6 +11,7 @@ export const idlFactory = ({ IDL }) => {
'icp_account_identifier' : IDL.Opt(IDL.Text),
'platform_fee_fixed' : IDL.Opt(IDL.Nat),
'is_active' : IDL.Bool,
'splits' : IDL.Vec(SplitRule),
});
const Result = IDL.Variant({ 'Ok' : IDL.Null, 'Err' : IDL.Text });
const TransactionStatus = IDL.Variant({
Expand All @@ -16,21 +21,27 @@ export const idlFactory = ({ IDL }) => {
'Completed' : IDL.Null,
'Pending' : IDL.Null,
});
const Split = IDL.Record({
'account_canister_id' : IDL.Nat64,
'index_block' : IDL.Opt(IDL.Nat64),
'timestamp' : IDL.Opt(IDL.Nat64),
'amount' : IDL.Nat,
});
const Transaction = IDL.Record({
'id' : IDL.Nat,
'status' : TransactionStatus,
'account_canister_id' : IDL.Nat64,
'platform_fee_amount' : IDL.Nat,
'transfer_fee' : IDL.Nat,
'memo' : IDL.Opt(IDL.Vec(IDL.Nat8)),
'index_to_account' : IDL.Opt(IDL.Nat64),
'timestamp_to_account' : IDL.Opt(IDL.Nat64),
'notify_processing' : IDL.Bool,
'timestamp' : IDL.Nat64,
'index_received' : IDL.Opt(IDL.Nat64),
'sender_principal_id' : IDL.Text,
'account_amount' : IDL.Nat,
'ledger_canister_id' : IDL.Text,
'splits' : IDL.Vec(Split),
'timestamp_received' : IDL.Opt(IDL.Nat64),
'amount' : IDL.Nat,
});
Expand Down