phygital-payment-sdk 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (318) hide show
  1. package/README.md +120 -0
  2. package/dist/arbiter/client.d.ts +34 -0
  3. package/dist/arbiter/client.d.ts.map +1 -0
  4. package/dist/arbiter/client.js +106 -0
  5. package/dist/arbiter/client.js.map +1 -0
  6. package/dist/core/amounts.d.ts +4 -0
  7. package/dist/core/amounts.d.ts.map +1 -0
  8. package/dist/core/amounts.js +36 -0
  9. package/dist/core/amounts.js.map +1 -0
  10. package/dist/core/bytes.d.ts +11 -0
  11. package/dist/core/bytes.d.ts.map +1 -0
  12. package/dist/core/bytes.js +69 -0
  13. package/dist/core/bytes.js.map +1 -0
  14. package/dist/core/challenge.d.ts +15 -0
  15. package/dist/core/challenge.d.ts.map +1 -0
  16. package/dist/core/challenge.js +24 -0
  17. package/dist/core/challenge.js.map +1 -0
  18. package/dist/core/errors.d.ts +90 -0
  19. package/dist/core/errors.d.ts.map +1 -0
  20. package/dist/core/errors.js +204 -0
  21. package/dist/core/errors.js.map +1 -0
  22. package/dist/core/events.d.ts +113 -0
  23. package/dist/core/events.d.ts.map +1 -0
  24. package/dist/core/events.js +258 -0
  25. package/dist/core/events.js.map +1 -0
  26. package/dist/core/evidence.d.ts +3 -0
  27. package/dist/core/evidence.d.ts.map +1 -0
  28. package/dist/core/evidence.js +7 -0
  29. package/dist/core/evidence.js.map +1 -0
  30. package/dist/core/execution-plan.d.ts +25 -0
  31. package/dist/core/execution-plan.d.ts.map +1 -0
  32. package/dist/core/execution-plan.js +57 -0
  33. package/dist/core/execution-plan.js.map +1 -0
  34. package/dist/core/indexer-store.d.ts +31 -0
  35. package/dist/core/indexer-store.d.ts.map +1 -0
  36. package/dist/core/indexer-store.js +2 -0
  37. package/dist/core/indexer-store.js.map +1 -0
  38. package/dist/core/instruction-codec.d.ts +13 -0
  39. package/dist/core/instruction-codec.d.ts.map +1 -0
  40. package/dist/core/instruction-codec.js +23 -0
  41. package/dist/core/instruction-codec.js.map +1 -0
  42. package/dist/core/payment.d.ts +116 -0
  43. package/dist/core/payment.d.ts.map +1 -0
  44. package/dist/core/payment.js +185 -0
  45. package/dist/core/payment.js.map +1 -0
  46. package/dist/core/pda.d.ts +29 -0
  47. package/dist/core/pda.d.ts.map +1 -0
  48. package/dist/core/pda.js +48 -0
  49. package/dist/core/pda.js.map +1 -0
  50. package/dist/core/provider-fee-payer.d.ts +5 -0
  51. package/dist/core/provider-fee-payer.d.ts.map +1 -0
  52. package/dist/core/provider-fee-payer.js +17 -0
  53. package/dist/core/provider-fee-payer.js.map +1 -0
  54. package/dist/core/provider-transport.d.ts +79 -0
  55. package/dist/core/provider-transport.d.ts.map +1 -0
  56. package/dist/core/provider-transport.js +151 -0
  57. package/dist/core/provider-transport.js.map +1 -0
  58. package/dist/core/status.d.ts +13 -0
  59. package/dist/core/status.d.ts.map +1 -0
  60. package/dist/core/status.js +17 -0
  61. package/dist/core/status.js.map +1 -0
  62. package/dist/core/time.d.ts +29 -0
  63. package/dist/core/time.d.ts.map +1 -0
  64. package/dist/core/time.js +66 -0
  65. package/dist/core/time.js.map +1 -0
  66. package/dist/core/transactions.d.ts +16 -0
  67. package/dist/core/transactions.d.ts.map +1 -0
  68. package/dist/core/transactions.js +87 -0
  69. package/dist/core/transactions.js.map +1 -0
  70. package/dist/generated/accounts/arbiter.d.ts +31 -0
  71. package/dist/generated/accounts/arbiter.d.ts.map +1 -0
  72. package/dist/generated/accounts/arbiter.js +57 -0
  73. package/dist/generated/accounts/arbiter.js.map +1 -0
  74. package/dist/generated/accounts/index.d.ts +5 -0
  75. package/dist/generated/accounts/index.d.ts.map +1 -0
  76. package/dist/generated/accounts/index.js +5 -0
  77. package/dist/generated/accounts/index.js.map +1 -0
  78. package/dist/generated/accounts/merchantOperator.d.ts +25 -0
  79. package/dist/generated/accounts/merchantOperator.d.ts.map +1 -0
  80. package/dist/generated/accounts/merchantOperator.js +49 -0
  81. package/dist/generated/accounts/merchantOperator.js.map +1 -0
  82. package/dist/generated/accounts/payment.d.ts +56 -0
  83. package/dist/generated/accounts/payment.d.ts.map +1 -0
  84. package/dist/generated/accounts/payment.js +82 -0
  85. package/dist/generated/accounts/payment.js.map +1 -0
  86. package/dist/generated/accounts/paymentAccount.d.ts +59 -0
  87. package/dist/generated/accounts/paymentAccount.d.ts.map +1 -0
  88. package/dist/generated/accounts/paymentAccount.js +83 -0
  89. package/dist/generated/accounts/paymentAccount.js.map +1 -0
  90. package/dist/generated/errors/index.d.ts +2 -0
  91. package/dist/generated/errors/index.d.ts.map +1 -0
  92. package/dist/generated/errors/index.js +2 -0
  93. package/dist/generated/errors/index.js.map +1 -0
  94. package/dist/generated/errors/phygitalPayment.d.ts +50 -0
  95. package/dist/generated/errors/phygitalPayment.d.ts.map +1 -0
  96. package/dist/generated/errors/phygitalPayment.js +91 -0
  97. package/dist/generated/errors/phygitalPayment.js.map +1 -0
  98. package/dist/generated/index.d.ts +7 -0
  99. package/dist/generated/index.d.ts.map +1 -0
  100. package/dist/generated/index.js +7 -0
  101. package/dist/generated/index.js.map +1 -0
  102. package/dist/generated/instructions/addMerchantOperator.d.ts +49 -0
  103. package/dist/generated/instructions/addMerchantOperator.d.ts.map +1 -0
  104. package/dist/generated/instructions/addMerchantOperator.js +110 -0
  105. package/dist/generated/instructions/addMerchantOperator.js.map +1 -0
  106. package/dist/generated/instructions/autoRefund.d.ts +48 -0
  107. package/dist/generated/instructions/autoRefund.d.ts.map +1 -0
  108. package/dist/generated/instructions/autoRefund.js +91 -0
  109. package/dist/generated/instructions/autoRefund.js.map +1 -0
  110. package/dist/generated/instructions/autoSettle.d.ts +45 -0
  111. package/dist/generated/instructions/autoSettle.d.ts.map +1 -0
  112. package/dist/generated/instructions/autoSettle.js +82 -0
  113. package/dist/generated/instructions/autoSettle.js.map +1 -0
  114. package/dist/generated/instructions/closeExpiredPayment.d.ts +36 -0
  115. package/dist/generated/instructions/closeExpiredPayment.d.ts.map +1 -0
  116. package/dist/generated/instructions/closeExpiredPayment.js +64 -0
  117. package/dist/generated/instructions/closeExpiredPayment.js.map +1 -0
  118. package/dist/generated/instructions/dispute.d.ts +49 -0
  119. package/dist/generated/instructions/dispute.d.ts.map +1 -0
  120. package/dist/generated/instructions/dispute.js +84 -0
  121. package/dist/generated/instructions/dispute.js.map +1 -0
  122. package/dist/generated/instructions/disputeAuthorization.d.ts +73 -0
  123. package/dist/generated/instructions/disputeAuthorization.d.ts.map +1 -0
  124. package/dist/generated/instructions/disputeAuthorization.js +149 -0
  125. package/dist/generated/instructions/disputeAuthorization.js.map +1 -0
  126. package/dist/generated/instructions/index.d.ts +21 -0
  127. package/dist/generated/instructions/index.d.ts.map +1 -0
  128. package/dist/generated/instructions/index.js +21 -0
  129. package/dist/generated/instructions/index.js.map +1 -0
  130. package/dist/generated/instructions/merchantRefund.d.ts +43 -0
  131. package/dist/generated/instructions/merchantRefund.d.ts.map +1 -0
  132. package/dist/generated/instructions/merchantRefund.js +78 -0
  133. package/dist/generated/instructions/merchantRefund.js.map +1 -0
  134. package/dist/generated/instructions/merchantRespond.d.ts +43 -0
  135. package/dist/generated/instructions/merchantRespond.d.ts.map +1 -0
  136. package/dist/generated/instructions/merchantRespond.js +78 -0
  137. package/dist/generated/instructions/merchantRespond.js.map +1 -0
  138. package/dist/generated/instructions/refundSettled.d.ts +52 -0
  139. package/dist/generated/instructions/refundSettled.d.ts.map +1 -0
  140. package/dist/generated/instructions/refundSettled.js +88 -0
  141. package/dist/generated/instructions/refundSettled.js.map +1 -0
  142. package/dist/generated/instructions/registerArbiter.d.ts +44 -0
  143. package/dist/generated/instructions/registerArbiter.d.ts.map +1 -0
  144. package/dist/generated/instructions/registerArbiter.js +94 -0
  145. package/dist/generated/instructions/registerArbiter.js.map +1 -0
  146. package/dist/generated/instructions/removeMerchantOperator.d.ts +45 -0
  147. package/dist/generated/instructions/removeMerchantOperator.d.ts.map +1 -0
  148. package/dist/generated/instructions/removeMerchantOperator.js +97 -0
  149. package/dist/generated/instructions/removeMerchantOperator.js.map +1 -0
  150. package/dist/generated/instructions/resolveDispute.d.ts +55 -0
  151. package/dist/generated/instructions/resolveDispute.d.ts.map +1 -0
  152. package/dist/generated/instructions/resolveDispute.js +91 -0
  153. package/dist/generated/instructions/resolveDispute.js.map +1 -0
  154. package/dist/generated/instructions/setApprovedArbiter.d.ts +57 -0
  155. package/dist/generated/instructions/setApprovedArbiter.d.ts.map +1 -0
  156. package/dist/generated/instructions/setApprovedArbiter.js +121 -0
  157. package/dist/generated/instructions/setApprovedArbiter.js.map +1 -0
  158. package/dist/generated/instructions/setAuthorizedCredential.d.ts +64 -0
  159. package/dist/generated/instructions/setAuthorizedCredential.d.ts.map +1 -0
  160. package/dist/generated/instructions/setAuthorizedCredential.js +138 -0
  161. package/dist/generated/instructions/setAuthorizedCredential.js.map +1 -0
  162. package/dist/generated/instructions/setPaymentEnabler.d.ts +65 -0
  163. package/dist/generated/instructions/setPaymentEnabler.d.ts.map +1 -0
  164. package/dist/generated/instructions/setPaymentEnabler.js +136 -0
  165. package/dist/generated/instructions/setPaymentEnabler.js.map +1 -0
  166. package/dist/generated/instructions/setReserve.d.ts +53 -0
  167. package/dist/generated/instructions/setReserve.d.ts.map +1 -0
  168. package/dist/generated/instructions/setReserve.js +109 -0
  169. package/dist/generated/instructions/setReserve.js.map +1 -0
  170. package/dist/generated/instructions/setTapLimit.d.ts +53 -0
  171. package/dist/generated/instructions/setTapLimit.d.ts.map +1 -0
  172. package/dist/generated/instructions/setTapLimit.js +109 -0
  173. package/dist/generated/instructions/setTapLimit.js.map +1 -0
  174. package/dist/generated/instructions/transfer.d.ts +97 -0
  175. package/dist/generated/instructions/transfer.d.ts.map +1 -0
  176. package/dist/generated/instructions/transfer.js +182 -0
  177. package/dist/generated/instructions/transfer.js.map +1 -0
  178. package/dist/generated/instructions/withdrawDispute.d.ts +36 -0
  179. package/dist/generated/instructions/withdrawDispute.d.ts.map +1 -0
  180. package/dist/generated/instructions/withdrawDispute.js +61 -0
  181. package/dist/generated/instructions/withdrawDispute.js.map +1 -0
  182. package/dist/generated/instructions/withdrawFromEscrow.d.ts +61 -0
  183. package/dist/generated/instructions/withdrawFromEscrow.d.ts.map +1 -0
  184. package/dist/generated/instructions/withdrawFromEscrow.js +132 -0
  185. package/dist/generated/instructions/withdrawFromEscrow.js.map +1 -0
  186. package/dist/generated/pdas/arbiterAccount.d.ts +8 -0
  187. package/dist/generated/pdas/arbiterAccount.d.ts.map +1 -0
  188. package/dist/generated/pdas/arbiterAccount.js +12 -0
  189. package/dist/generated/pdas/arbiterAccount.js.map +1 -0
  190. package/dist/generated/pdas/index.d.ts +6 -0
  191. package/dist/generated/pdas/index.d.ts.map +1 -0
  192. package/dist/generated/pdas/index.js +6 -0
  193. package/dist/generated/pdas/index.js.map +1 -0
  194. package/dist/generated/pdas/merchantOperator.d.ts +9 -0
  195. package/dist/generated/pdas/merchantOperator.d.ts.map +1 -0
  196. package/dist/generated/pdas/merchantOperator.js +16 -0
  197. package/dist/generated/pdas/merchantOperator.js.map +1 -0
  198. package/dist/generated/pdas/payment.d.ts +9 -0
  199. package/dist/generated/pdas/payment.d.ts.map +1 -0
  200. package/dist/generated/pdas/payment.js +13 -0
  201. package/dist/generated/pdas/payment.js.map +1 -0
  202. package/dist/generated/pdas/paymentAccount.d.ts +10 -0
  203. package/dist/generated/pdas/paymentAccount.d.ts.map +1 -0
  204. package/dist/generated/pdas/paymentAccount.js +16 -0
  205. package/dist/generated/pdas/paymentAccount.js.map +1 -0
  206. package/dist/generated/pdas/setApprovedArbiterArbiterAccount.d.ts +8 -0
  207. package/dist/generated/pdas/setApprovedArbiterArbiterAccount.d.ts.map +1 -0
  208. package/dist/generated/pdas/setApprovedArbiterArbiterAccount.js +12 -0
  209. package/dist/generated/pdas/setApprovedArbiterArbiterAccount.js.map +1 -0
  210. package/dist/generated/programs/index.d.ts +2 -0
  211. package/dist/generated/programs/index.d.ts.map +1 -0
  212. package/dist/generated/programs/index.js +2 -0
  213. package/dist/generated/programs/index.js.map +1 -0
  214. package/dist/generated/programs/phygitalPayment.d.ts +132 -0
  215. package/dist/generated/programs/phygitalPayment.d.ts.map +1 -0
  216. package/dist/generated/programs/phygitalPayment.js +322 -0
  217. package/dist/generated/programs/phygitalPayment.js.map +1 -0
  218. package/dist/generated/types/index.d.ts +2 -0
  219. package/dist/generated/types/index.d.ts.map +1 -0
  220. package/dist/generated/types/index.js +2 -0
  221. package/dist/generated/types/index.js.map +1 -0
  222. package/dist/generated/types/paymentFlags.d.ts +7 -0
  223. package/dist/generated/types/paymentFlags.d.ts.map +1 -0
  224. package/dist/generated/types/paymentFlags.js +11 -0
  225. package/dist/generated/types/paymentFlags.js.map +1 -0
  226. package/dist/index.d.ts +25 -0
  227. package/dist/index.d.ts.map +1 -0
  228. package/dist/index.js +23 -0
  229. package/dist/index.js.map +1 -0
  230. package/dist/merchant/charge.d.ts +106 -0
  231. package/dist/merchant/charge.d.ts.map +1 -0
  232. package/dist/merchant/charge.js +311 -0
  233. package/dist/merchant/charge.js.map +1 -0
  234. package/dist/merchant/client.d.ts +80 -0
  235. package/dist/merchant/client.d.ts.map +1 -0
  236. package/dist/merchant/client.js +282 -0
  237. package/dist/merchant/client.js.map +1 -0
  238. package/dist/merchant/deferred-queue.d.ts +35 -0
  239. package/dist/merchant/deferred-queue.d.ts.map +1 -0
  240. package/dist/merchant/deferred-queue.js +237 -0
  241. package/dist/merchant/deferred-queue.js.map +1 -0
  242. package/dist/merchant/deferred-store.d.ts +67 -0
  243. package/dist/merchant/deferred-store.d.ts.map +1 -0
  244. package/dist/merchant/deferred-store.js +126 -0
  245. package/dist/merchant/deferred-store.js.map +1 -0
  246. package/dist/merchant/indexed-db-store.d.ts +6 -0
  247. package/dist/merchant/indexed-db-store.d.ts.map +1 -0
  248. package/dist/merchant/indexed-db-store.js +121 -0
  249. package/dist/merchant/indexed-db-store.js.map +1 -0
  250. package/dist/merchant/tap.d.ts +11 -0
  251. package/dist/merchant/tap.d.ts.map +1 -0
  252. package/dist/merchant/tap.js +47 -0
  253. package/dist/merchant/tap.js.map +1 -0
  254. package/dist/server/closable-store.d.ts +12 -0
  255. package/dist/server/closable-store.d.ts.map +1 -0
  256. package/dist/server/closable-store.js +16 -0
  257. package/dist/server/closable-store.js.map +1 -0
  258. package/dist/server/deferred-flusher.d.ts +19 -0
  259. package/dist/server/deferred-flusher.d.ts.map +1 -0
  260. package/dist/server/deferred-flusher.js +57 -0
  261. package/dist/server/deferred-flusher.js.map +1 -0
  262. package/dist/server/enabler-service.d.ts +20 -0
  263. package/dist/server/enabler-service.d.ts.map +1 -0
  264. package/dist/server/enabler-service.js +191 -0
  265. package/dist/server/enabler-service.js.map +1 -0
  266. package/dist/server/enabler-signer.d.ts +11 -0
  267. package/dist/server/enabler-signer.d.ts.map +1 -0
  268. package/dist/server/enabler-signer.js +37 -0
  269. package/dist/server/enabler-signer.js.map +1 -0
  270. package/dist/server/fee-budget.d.ts +22 -0
  271. package/dist/server/fee-budget.d.ts.map +1 -0
  272. package/dist/server/fee-budget.js +58 -0
  273. package/dist/server/fee-budget.js.map +1 -0
  274. package/dist/server/fee-payer.d.ts +27 -0
  275. package/dist/server/fee-payer.d.ts.map +1 -0
  276. package/dist/server/fee-payer.js +167 -0
  277. package/dist/server/fee-payer.js.map +1 -0
  278. package/dist/server/index.d.ts +14 -0
  279. package/dist/server/index.d.ts.map +1 -0
  280. package/dist/server/index.js +14 -0
  281. package/dist/server/index.js.map +1 -0
  282. package/dist/server/indexer.d.ts +50 -0
  283. package/dist/server/indexer.d.ts.map +1 -0
  284. package/dist/server/indexer.js +218 -0
  285. package/dist/server/indexer.js.map +1 -0
  286. package/dist/server/keeper.d.ts +34 -0
  287. package/dist/server/keeper.d.ts.map +1 -0
  288. package/dist/server/keeper.js +246 -0
  289. package/dist/server/keeper.js.map +1 -0
  290. package/dist/server/pending-taps.d.ts +12 -0
  291. package/dist/server/pending-taps.d.ts.map +1 -0
  292. package/dist/server/pending-taps.js +19 -0
  293. package/dist/server/pending-taps.js.map +1 -0
  294. package/dist/server/policy.d.ts +46 -0
  295. package/dist/server/policy.d.ts.map +1 -0
  296. package/dist/server/policy.js +47 -0
  297. package/dist/server/policy.js.map +1 -0
  298. package/dist/server/provider-deferred-queue.d.ts +21 -0
  299. package/dist/server/provider-deferred-queue.d.ts.map +1 -0
  300. package/dist/server/provider-deferred-queue.js +69 -0
  301. package/dist/server/provider-deferred-queue.js.map +1 -0
  302. package/dist/server/queue.d.ts +43 -0
  303. package/dist/server/queue.d.ts.map +1 -0
  304. package/dist/server/queue.js +105 -0
  305. package/dist/server/queue.js.map +1 -0
  306. package/dist/server/router.d.ts +21 -0
  307. package/dist/server/router.d.ts.map +1 -0
  308. package/dist/server/router.js +137 -0
  309. package/dist/server/router.js.map +1 -0
  310. package/dist/server/webauthn.d.ts +2 -0
  311. package/dist/server/webauthn.d.ts.map +1 -0
  312. package/dist/server/webauthn.js +19 -0
  313. package/dist/server/webauthn.js.map +1 -0
  314. package/dist/wallet/client.d.ts +106 -0
  315. package/dist/wallet/client.d.ts.map +1 -0
  316. package/dist/wallet/client.js +354 -0
  317. package/dist/wallet/client.js.map +1 -0
  318. package/package.json +75 -0
@@ -0,0 +1,322 @@
1
+ import { assertIsInstructionWithAccounts, containsBytes, extendClient, fixEncoderSize, getBytesEncoder, SOLANA_ERROR__PROGRAM_CLIENTS__FAILED_TO_IDENTIFY_ACCOUNT, SOLANA_ERROR__PROGRAM_CLIENTS__FAILED_TO_IDENTIFY_INSTRUCTION, SOLANA_ERROR__PROGRAM_CLIENTS__UNRECOGNIZED_INSTRUCTION_TYPE, SolanaError, } from "@solana/kit";
2
+ import { addSelfFetchFunctions, addSelfPlanAndSendFunctions, } from "@solana/program-client-core";
3
+ import { getArbiterCodec, getMerchantOperatorCodec, getPaymentAccountCodec, getPaymentCodec, } from "../accounts/index.js";
4
+ import { getAddMerchantOperatorInstructionAsync, getAutoRefundInstruction, getAutoSettleInstruction, getCloseExpiredPaymentInstruction, getDisputeAuthorizationInstructionAsync, getDisputeInstruction, getMerchantRefundInstruction, getMerchantRespondInstruction, getRefundSettledInstruction, getRegisterArbiterInstructionAsync, getRemoveMerchantOperatorInstructionAsync, getResolveDisputeInstruction, getSetApprovedArbiterInstructionAsync, getSetAuthorizedCredentialInstructionAsync, getSetPaymentEnablerInstructionAsync, getSetReserveInstructionAsync, getSetTapLimitInstructionAsync, getTransferInstructionAsync, getWithdrawDisputeInstruction, getWithdrawFromEscrowInstructionAsync, parseAddMerchantOperatorInstruction, parseAutoRefundInstruction, parseAutoSettleInstruction, parseCloseExpiredPaymentInstruction, parseDisputeAuthorizationInstruction, parseDisputeInstruction, parseMerchantRefundInstruction, parseMerchantRespondInstruction, parseRefundSettledInstruction, parseRegisterArbiterInstruction, parseRemoveMerchantOperatorInstruction, parseResolveDisputeInstruction, parseSetApprovedArbiterInstruction, parseSetAuthorizedCredentialInstruction, parseSetPaymentEnablerInstruction, parseSetReserveInstruction, parseSetTapLimitInstruction, parseTransferInstruction, parseWithdrawDisputeInstruction, parseWithdrawFromEscrowInstruction, } from "../instructions/index.js";
5
+ import { findArbiterAccountPda, findMerchantOperatorPda, findPaymentAccountPda, findPaymentPda, findSetApprovedArbiterArbiterAccountPda, } from "../pdas/index.js";
6
+ export const PHYGITAL_PAYMENT_PROGRAM_ADDRESS = "Hy8HdxYZrPbAdMgMkL9ZVdJDNesZrihUVQLjoT16jacV";
7
+ export var PhygitalPaymentAccount;
8
+ (function (PhygitalPaymentAccount) {
9
+ PhygitalPaymentAccount[PhygitalPaymentAccount["Arbiter"] = 0] = "Arbiter";
10
+ PhygitalPaymentAccount[PhygitalPaymentAccount["MerchantOperator"] = 1] = "MerchantOperator";
11
+ PhygitalPaymentAccount[PhygitalPaymentAccount["Payment"] = 2] = "Payment";
12
+ PhygitalPaymentAccount[PhygitalPaymentAccount["PaymentAccount"] = 3] = "PaymentAccount";
13
+ })(PhygitalPaymentAccount || (PhygitalPaymentAccount = {}));
14
+ export function identifyPhygitalPaymentAccount(account) {
15
+ const data = "data" in account ? account.data : account;
16
+ if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([73, 85, 239, 61, 111, 43, 95, 83])), 0)) {
17
+ return PhygitalPaymentAccount.Arbiter;
18
+ }
19
+ if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([122, 171, 77, 92, 149, 221, 56, 83])), 0)) {
20
+ return PhygitalPaymentAccount.MerchantOperator;
21
+ }
22
+ if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([227, 231, 51, 26, 244, 88, 4, 148])), 0)) {
23
+ return PhygitalPaymentAccount.Payment;
24
+ }
25
+ if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([47, 239, 218, 78, 43, 193, 1, 61])), 0)) {
26
+ return PhygitalPaymentAccount.PaymentAccount;
27
+ }
28
+ throw new SolanaError(SOLANA_ERROR__PROGRAM_CLIENTS__FAILED_TO_IDENTIFY_ACCOUNT, { accountData: data, programName: "phygitalPayment" });
29
+ }
30
+ export var PhygitalPaymentInstruction;
31
+ (function (PhygitalPaymentInstruction) {
32
+ PhygitalPaymentInstruction[PhygitalPaymentInstruction["AddMerchantOperator"] = 0] = "AddMerchantOperator";
33
+ PhygitalPaymentInstruction[PhygitalPaymentInstruction["AutoRefund"] = 1] = "AutoRefund";
34
+ PhygitalPaymentInstruction[PhygitalPaymentInstruction["AutoSettle"] = 2] = "AutoSettle";
35
+ PhygitalPaymentInstruction[PhygitalPaymentInstruction["CloseExpiredPayment"] = 3] = "CloseExpiredPayment";
36
+ PhygitalPaymentInstruction[PhygitalPaymentInstruction["Dispute"] = 4] = "Dispute";
37
+ PhygitalPaymentInstruction[PhygitalPaymentInstruction["DisputeAuthorization"] = 5] = "DisputeAuthorization";
38
+ PhygitalPaymentInstruction[PhygitalPaymentInstruction["MerchantRefund"] = 6] = "MerchantRefund";
39
+ PhygitalPaymentInstruction[PhygitalPaymentInstruction["MerchantRespond"] = 7] = "MerchantRespond";
40
+ PhygitalPaymentInstruction[PhygitalPaymentInstruction["RefundSettled"] = 8] = "RefundSettled";
41
+ PhygitalPaymentInstruction[PhygitalPaymentInstruction["RegisterArbiter"] = 9] = "RegisterArbiter";
42
+ PhygitalPaymentInstruction[PhygitalPaymentInstruction["RemoveMerchantOperator"] = 10] = "RemoveMerchantOperator";
43
+ PhygitalPaymentInstruction[PhygitalPaymentInstruction["ResolveDispute"] = 11] = "ResolveDispute";
44
+ PhygitalPaymentInstruction[PhygitalPaymentInstruction["SetApprovedArbiter"] = 12] = "SetApprovedArbiter";
45
+ PhygitalPaymentInstruction[PhygitalPaymentInstruction["SetAuthorizedCredential"] = 13] = "SetAuthorizedCredential";
46
+ PhygitalPaymentInstruction[PhygitalPaymentInstruction["SetPaymentEnabler"] = 14] = "SetPaymentEnabler";
47
+ PhygitalPaymentInstruction[PhygitalPaymentInstruction["SetReserve"] = 15] = "SetReserve";
48
+ PhygitalPaymentInstruction[PhygitalPaymentInstruction["SetTapLimit"] = 16] = "SetTapLimit";
49
+ PhygitalPaymentInstruction[PhygitalPaymentInstruction["Transfer"] = 17] = "Transfer";
50
+ PhygitalPaymentInstruction[PhygitalPaymentInstruction["WithdrawDispute"] = 18] = "WithdrawDispute";
51
+ PhygitalPaymentInstruction[PhygitalPaymentInstruction["WithdrawFromEscrow"] = 19] = "WithdrawFromEscrow";
52
+ })(PhygitalPaymentInstruction || (PhygitalPaymentInstruction = {}));
53
+ export function identifyPhygitalPaymentInstruction(instruction) {
54
+ const data = "data" in instruction ? instruction.data : instruction;
55
+ if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([160, 241, 116, 182, 141, 76, 74, 56])), 0)) {
56
+ return PhygitalPaymentInstruction.AddMerchantOperator;
57
+ }
58
+ if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([64, 219, 182, 3, 234, 13, 10, 209])), 0)) {
59
+ return PhygitalPaymentInstruction.AutoRefund;
60
+ }
61
+ if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([202, 4, 163, 200, 85, 15, 60, 167])), 0)) {
62
+ return PhygitalPaymentInstruction.AutoSettle;
63
+ }
64
+ if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([250, 91, 33, 174, 90, 205, 186, 38])), 0)) {
65
+ return PhygitalPaymentInstruction.CloseExpiredPayment;
66
+ }
67
+ if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([216, 92, 128, 146, 202, 85, 135, 73])), 0)) {
68
+ return PhygitalPaymentInstruction.Dispute;
69
+ }
70
+ if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([210, 12, 176, 156, 109, 64, 171, 10])), 0)) {
71
+ return PhygitalPaymentInstruction.DisputeAuthorization;
72
+ }
73
+ if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([226, 105, 45, 58, 178, 218, 130, 196])), 0)) {
74
+ return PhygitalPaymentInstruction.MerchantRefund;
75
+ }
76
+ if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([117, 140, 86, 221, 52, 21, 144, 185])), 0)) {
77
+ return PhygitalPaymentInstruction.MerchantRespond;
78
+ }
79
+ if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([160, 234, 172, 227, 66, 209, 8, 161])), 0)) {
80
+ return PhygitalPaymentInstruction.RefundSettled;
81
+ }
82
+ if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([185, 108, 17, 171, 205, 78, 178, 226])), 0)) {
83
+ return PhygitalPaymentInstruction.RegisterArbiter;
84
+ }
85
+ if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([0, 71, 49, 53, 163, 109, 191, 6])), 0)) {
86
+ return PhygitalPaymentInstruction.RemoveMerchantOperator;
87
+ }
88
+ if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([231, 6, 202, 6, 96, 103, 12, 230])), 0)) {
89
+ return PhygitalPaymentInstruction.ResolveDispute;
90
+ }
91
+ if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([254, 219, 155, 117, 17, 95, 219, 173])), 0)) {
92
+ return PhygitalPaymentInstruction.SetApprovedArbiter;
93
+ }
94
+ if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([17, 199, 52, 243, 218, 208, 6, 72])), 0)) {
95
+ return PhygitalPaymentInstruction.SetAuthorizedCredential;
96
+ }
97
+ if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([173, 241, 45, 244, 139, 127, 55, 181])), 0)) {
98
+ return PhygitalPaymentInstruction.SetPaymentEnabler;
99
+ }
100
+ if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([182, 227, 121, 230, 162, 141, 154, 169])), 0)) {
101
+ return PhygitalPaymentInstruction.SetReserve;
102
+ }
103
+ if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([66, 56, 58, 129, 117, 163, 192, 72])), 0)) {
104
+ return PhygitalPaymentInstruction.SetTapLimit;
105
+ }
106
+ if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([163, 52, 200, 231, 140, 3, 69, 186])), 0)) {
107
+ return PhygitalPaymentInstruction.Transfer;
108
+ }
109
+ if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([96, 143, 114, 202, 143, 131, 26, 134])), 0)) {
110
+ return PhygitalPaymentInstruction.WithdrawDispute;
111
+ }
112
+ if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([235, 206, 216, 253, 47, 163, 169, 231])), 0)) {
113
+ return PhygitalPaymentInstruction.WithdrawFromEscrow;
114
+ }
115
+ throw new SolanaError(SOLANA_ERROR__PROGRAM_CLIENTS__FAILED_TO_IDENTIFY_INSTRUCTION, { instructionData: data, programName: "phygitalPayment" });
116
+ }
117
+ export function parsePhygitalPaymentInstruction(instruction) {
118
+ const instructionType = identifyPhygitalPaymentInstruction(instruction);
119
+ switch (instructionType) {
120
+ case PhygitalPaymentInstruction.AddMerchantOperator: {
121
+ assertIsInstructionWithAccounts(instruction);
122
+ return {
123
+ instructionType: PhygitalPaymentInstruction.AddMerchantOperator,
124
+ ...parseAddMerchantOperatorInstruction(instruction),
125
+ };
126
+ }
127
+ case PhygitalPaymentInstruction.AutoRefund: {
128
+ assertIsInstructionWithAccounts(instruction);
129
+ return {
130
+ instructionType: PhygitalPaymentInstruction.AutoRefund,
131
+ ...parseAutoRefundInstruction(instruction),
132
+ };
133
+ }
134
+ case PhygitalPaymentInstruction.AutoSettle: {
135
+ assertIsInstructionWithAccounts(instruction);
136
+ return {
137
+ instructionType: PhygitalPaymentInstruction.AutoSettle,
138
+ ...parseAutoSettleInstruction(instruction),
139
+ };
140
+ }
141
+ case PhygitalPaymentInstruction.CloseExpiredPayment: {
142
+ assertIsInstructionWithAccounts(instruction);
143
+ return {
144
+ instructionType: PhygitalPaymentInstruction.CloseExpiredPayment,
145
+ ...parseCloseExpiredPaymentInstruction(instruction),
146
+ };
147
+ }
148
+ case PhygitalPaymentInstruction.Dispute: {
149
+ assertIsInstructionWithAccounts(instruction);
150
+ return {
151
+ instructionType: PhygitalPaymentInstruction.Dispute,
152
+ ...parseDisputeInstruction(instruction),
153
+ };
154
+ }
155
+ case PhygitalPaymentInstruction.DisputeAuthorization: {
156
+ assertIsInstructionWithAccounts(instruction);
157
+ return {
158
+ instructionType: PhygitalPaymentInstruction.DisputeAuthorization,
159
+ ...parseDisputeAuthorizationInstruction(instruction),
160
+ };
161
+ }
162
+ case PhygitalPaymentInstruction.MerchantRefund: {
163
+ assertIsInstructionWithAccounts(instruction);
164
+ return {
165
+ instructionType: PhygitalPaymentInstruction.MerchantRefund,
166
+ ...parseMerchantRefundInstruction(instruction),
167
+ };
168
+ }
169
+ case PhygitalPaymentInstruction.MerchantRespond: {
170
+ assertIsInstructionWithAccounts(instruction);
171
+ return {
172
+ instructionType: PhygitalPaymentInstruction.MerchantRespond,
173
+ ...parseMerchantRespondInstruction(instruction),
174
+ };
175
+ }
176
+ case PhygitalPaymentInstruction.RefundSettled: {
177
+ assertIsInstructionWithAccounts(instruction);
178
+ return {
179
+ instructionType: PhygitalPaymentInstruction.RefundSettled,
180
+ ...parseRefundSettledInstruction(instruction),
181
+ };
182
+ }
183
+ case PhygitalPaymentInstruction.RegisterArbiter: {
184
+ assertIsInstructionWithAccounts(instruction);
185
+ return {
186
+ instructionType: PhygitalPaymentInstruction.RegisterArbiter,
187
+ ...parseRegisterArbiterInstruction(instruction),
188
+ };
189
+ }
190
+ case PhygitalPaymentInstruction.RemoveMerchantOperator: {
191
+ assertIsInstructionWithAccounts(instruction);
192
+ return {
193
+ instructionType: PhygitalPaymentInstruction.RemoveMerchantOperator,
194
+ ...parseRemoveMerchantOperatorInstruction(instruction),
195
+ };
196
+ }
197
+ case PhygitalPaymentInstruction.ResolveDispute: {
198
+ assertIsInstructionWithAccounts(instruction);
199
+ return {
200
+ instructionType: PhygitalPaymentInstruction.ResolveDispute,
201
+ ...parseResolveDisputeInstruction(instruction),
202
+ };
203
+ }
204
+ case PhygitalPaymentInstruction.SetApprovedArbiter: {
205
+ assertIsInstructionWithAccounts(instruction);
206
+ return {
207
+ instructionType: PhygitalPaymentInstruction.SetApprovedArbiter,
208
+ ...parseSetApprovedArbiterInstruction(instruction),
209
+ };
210
+ }
211
+ case PhygitalPaymentInstruction.SetAuthorizedCredential: {
212
+ assertIsInstructionWithAccounts(instruction);
213
+ return {
214
+ instructionType: PhygitalPaymentInstruction.SetAuthorizedCredential,
215
+ ...parseSetAuthorizedCredentialInstruction(instruction),
216
+ };
217
+ }
218
+ case PhygitalPaymentInstruction.SetPaymentEnabler: {
219
+ assertIsInstructionWithAccounts(instruction);
220
+ return {
221
+ instructionType: PhygitalPaymentInstruction.SetPaymentEnabler,
222
+ ...parseSetPaymentEnablerInstruction(instruction),
223
+ };
224
+ }
225
+ case PhygitalPaymentInstruction.SetReserve: {
226
+ assertIsInstructionWithAccounts(instruction);
227
+ return {
228
+ instructionType: PhygitalPaymentInstruction.SetReserve,
229
+ ...parseSetReserveInstruction(instruction),
230
+ };
231
+ }
232
+ case PhygitalPaymentInstruction.SetTapLimit: {
233
+ assertIsInstructionWithAccounts(instruction);
234
+ return {
235
+ instructionType: PhygitalPaymentInstruction.SetTapLimit,
236
+ ...parseSetTapLimitInstruction(instruction),
237
+ };
238
+ }
239
+ case PhygitalPaymentInstruction.Transfer: {
240
+ assertIsInstructionWithAccounts(instruction);
241
+ return {
242
+ instructionType: PhygitalPaymentInstruction.Transfer,
243
+ ...parseTransferInstruction(instruction),
244
+ };
245
+ }
246
+ case PhygitalPaymentInstruction.WithdrawDispute: {
247
+ assertIsInstructionWithAccounts(instruction);
248
+ return {
249
+ instructionType: PhygitalPaymentInstruction.WithdrawDispute,
250
+ ...parseWithdrawDisputeInstruction(instruction),
251
+ };
252
+ }
253
+ case PhygitalPaymentInstruction.WithdrawFromEscrow: {
254
+ assertIsInstructionWithAccounts(instruction);
255
+ return {
256
+ instructionType: PhygitalPaymentInstruction.WithdrawFromEscrow,
257
+ ...parseWithdrawFromEscrowInstruction(instruction),
258
+ };
259
+ }
260
+ default:
261
+ throw new SolanaError(SOLANA_ERROR__PROGRAM_CLIENTS__UNRECOGNIZED_INSTRUCTION_TYPE, {
262
+ instructionType: instructionType,
263
+ programName: "phygitalPayment",
264
+ });
265
+ }
266
+ }
267
+ export function phygitalPaymentProgram() {
268
+ return (client) => {
269
+ return extendClient(client, {
270
+ phygitalPayment: {
271
+ accounts: {
272
+ arbiter: addSelfFetchFunctions(client, getArbiterCodec()),
273
+ merchantOperator: addSelfFetchFunctions(client, getMerchantOperatorCodec()),
274
+ payment: addSelfFetchFunctions(client, getPaymentCodec()),
275
+ paymentAccount: addSelfFetchFunctions(client, getPaymentAccountCodec()),
276
+ },
277
+ instructions: {
278
+ addMerchantOperator: (input) => addSelfPlanAndSendFunctions(client, getAddMerchantOperatorInstructionAsync(input)),
279
+ autoRefund: (input) => addSelfPlanAndSendFunctions(client, getAutoRefundInstruction(input)),
280
+ autoSettle: (input) => addSelfPlanAndSendFunctions(client, getAutoSettleInstruction(input)),
281
+ closeExpiredPayment: (input) => addSelfPlanAndSendFunctions(client, getCloseExpiredPaymentInstruction(input)),
282
+ dispute: (input) => addSelfPlanAndSendFunctions(client, getDisputeInstruction(input)),
283
+ disputeAuthorization: (input) => addSelfPlanAndSendFunctions(client, getDisputeAuthorizationInstructionAsync(input)),
284
+ merchantRefund: (input) => addSelfPlanAndSendFunctions(client, getMerchantRefundInstruction(input)),
285
+ merchantRespond: (input) => addSelfPlanAndSendFunctions(client, getMerchantRespondInstruction(input)),
286
+ refundSettled: (input) => addSelfPlanAndSendFunctions(client, getRefundSettledInstruction(input)),
287
+ registerArbiter: (input) => addSelfPlanAndSendFunctions(client, getRegisterArbiterInstructionAsync(input)),
288
+ removeMerchantOperator: (input) => addSelfPlanAndSendFunctions(client, getRemoveMerchantOperatorInstructionAsync(input)),
289
+ resolveDispute: (input) => addSelfPlanAndSendFunctions(client, getResolveDisputeInstruction(input)),
290
+ setApprovedArbiter: (input) => addSelfPlanAndSendFunctions(client, getSetApprovedArbiterInstructionAsync(input)),
291
+ setAuthorizedCredential: (input) => addSelfPlanAndSendFunctions(client, getSetAuthorizedCredentialInstructionAsync({
292
+ ...input,
293
+ payer: input.payer ?? client.payer,
294
+ })),
295
+ setPaymentEnabler: (input) => addSelfPlanAndSendFunctions(client, getSetPaymentEnablerInstructionAsync({
296
+ ...input,
297
+ payer: input.payer ?? client.payer,
298
+ })),
299
+ setReserve: (input) => addSelfPlanAndSendFunctions(client, getSetReserveInstructionAsync(input)),
300
+ setTapLimit: (input) => addSelfPlanAndSendFunctions(client, getSetTapLimitInstructionAsync(input)),
301
+ transfer: (input) => addSelfPlanAndSendFunctions(client, getTransferInstructionAsync(input)),
302
+ withdrawDispute: (input) => addSelfPlanAndSendFunctions(client, getWithdrawDisputeInstruction({
303
+ ...input,
304
+ payer: input.payer ?? client.payer,
305
+ })),
306
+ withdrawFromEscrow: (input) => addSelfPlanAndSendFunctions(client, getWithdrawFromEscrowInstructionAsync(input)),
307
+ },
308
+ pdas: {
309
+ merchantOperator: findMerchantOperatorPda,
310
+ paymentAccount: findPaymentAccountPda,
311
+ payment: findPaymentPda,
312
+ arbiterAccount: findArbiterAccountPda,
313
+ setApprovedArbiterArbiterAccount: findSetApprovedArbiterArbiterAccountPda,
314
+ },
315
+ identifyAccount: identifyPhygitalPaymentAccount,
316
+ identifyInstruction: identifyPhygitalPaymentInstruction,
317
+ parseInstruction: parsePhygitalPaymentInstruction,
318
+ },
319
+ });
320
+ };
321
+ }
322
+ //# sourceMappingURL=phygitalPayment.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"phygitalPayment.js","sourceRoot":"","sources":["../../../src/generated/programs/phygitalPayment.ts"],"names":[],"mappings":"AAQA,OAAO,EACL,+BAA+B,EAC/B,aAAa,EACb,YAAY,EACZ,cAAc,EACd,eAAe,EACf,yDAAyD,EACzD,6DAA6D,EAC7D,4DAA4D,EAC5D,WAAW,GAYZ,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,qBAAqB,EACrB,2BAA2B,GAG5B,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,eAAe,EACf,wBAAwB,EACxB,sBAAsB,EACtB,eAAe,GAShB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,sCAAsC,EACtC,wBAAwB,EACxB,wBAAwB,EACxB,iCAAiC,EACjC,uCAAuC,EACvC,qBAAqB,EACrB,4BAA4B,EAC5B,6BAA6B,EAC7B,2BAA2B,EAC3B,kCAAkC,EAClC,yCAAyC,EACzC,4BAA4B,EAC5B,qCA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,KAAK,EAAE,EAAE,CACzB,2BAA2B,CACzB,MAAM,EACN,6BAA6B,CAAC;wBAC5B,GAAG,KAAK;wBACR,KAAK,EAAE,KAAK,CAAC,KAAK,IAAI,MAAM,CAAC,KAAK;qBACnC,CAAC,CACH;oBACH,kBAAkB,EAAE,CAAC,KAAK,EAAE,EAAE,CAC5B,2BAA2B,CACzB,MAAM,EACN,qCAAqC,CAAC,KAAK,CAAC,CAC7C;iBACJ;gBACD,IAAI,EAAE;oBACJ,gBAAgB,EAAE,uBAAuB;oBACzC,cAAc,EAAE,qBAAqB;oBACrC,OAAO,EAAE,cAAc;oBACvB,cAAc,EAAE,qBAAqB;oBACrC,gCAAgC,EAC9B,uCAAuC;iBAC1C;gBACD,eAAe,EAAE,8BAA8B;gBAC/C,mBAAmB,EAAE,kCAAkC;gBACvD,gBAAgB,EAAE,+BAA+B;aAClD;SACF,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from "./paymentFlags.js";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/generated/types/index.ts"],"names":[],"mappings":"AAQA,cAAc,mBAAmB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from "./paymentFlags.js";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/generated/types/index.ts"],"names":[],"mappings":"AAQA,cAAc,mBAAmB,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { type FixedSizeCodec, type FixedSizeDecoder, type FixedSizeEncoder } from "@solana/kit";
2
+ export type PaymentFlags = readonly [number];
3
+ export type PaymentFlagsArgs = PaymentFlags;
4
+ export declare function getPaymentFlagsEncoder(): FixedSizeEncoder<PaymentFlagsArgs>;
5
+ export declare function getPaymentFlagsDecoder(): FixedSizeDecoder<PaymentFlags>;
6
+ export declare function getPaymentFlagsCodec(): FixedSizeCodec<PaymentFlagsArgs, PaymentFlags>;
7
+ //# sourceMappingURL=paymentFlags.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"paymentFlags.d.ts","sourceRoot":"","sources":["../../../src/generated/types/paymentFlags.ts"],"names":[],"mappings":"AAQA,OAAO,EAML,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACtB,MAAM,aAAa,CAAC;AAGrB,MAAM,MAAM,YAAY,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC;AAE7C,MAAM,MAAM,gBAAgB,GAAG,YAAY,CAAC;AAE5C,wBAAgB,sBAAsB,IAAI,gBAAgB,CAAC,gBAAgB,CAAC,CAE3E;AAED,wBAAgB,sBAAsB,IAAI,gBAAgB,CAAC,YAAY,CAAC,CAEvE;AAED,wBAAgB,oBAAoB,IAAI,cAAc,CACpD,gBAAgB,EAChB,YAAY,CACb,CAEA"}
@@ -0,0 +1,11 @@
1
+ import { combineCodec, getTupleDecoder, getTupleEncoder, getU8Decoder, getU8Encoder, } from "@solana/kit";
2
+ export function getPaymentFlagsEncoder() {
3
+ return getTupleEncoder([getU8Encoder()]);
4
+ }
5
+ export function getPaymentFlagsDecoder() {
6
+ return getTupleDecoder([getU8Decoder()]);
7
+ }
8
+ export function getPaymentFlagsCodec() {
9
+ return combineCodec(getPaymentFlagsEncoder(), getPaymentFlagsDecoder());
10
+ }
11
+ //# sourceMappingURL=paymentFlags.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"paymentFlags.js","sourceRoot":"","sources":["../../../src/generated/types/paymentFlags.ts"],"names":[],"mappings":"AAQA,OAAO,EACL,YAAY,EACZ,eAAe,EACf,eAAe,EACf,YAAY,EACZ,YAAY,GAIb,MAAM,aAAa,CAAC;AAOrB,MAAM,UAAU,sBAAsB;IACpC,OAAO,eAAe,CAAC,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC;AAC3C,CAAC;AAED,MAAM,UAAU,sBAAsB;IACpC,OAAO,eAAe,CAAC,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC;AAC3C,CAAC;AAED,MAAM,UAAU,oBAAoB;IAIlC,OAAO,YAAY,CAAC,sBAAsB,EAAE,EAAE,sBAAsB,EAAE,CAAC,CAAC;AAC1E,CAAC"}
@@ -0,0 +1,25 @@
1
+ export { createMerchantClient, type MerchantClient, type MerchantClientConfig, } from "./merchant/client.js";
2
+ export { CosignLandError, type ChargeParams, type ChargeProgressEvent, type ChargeResult, type CosignedTap, type ResumeChargeParams, } from "./merchant/charge.js";
3
+ export { createDeferredQueue, packTapsForBatch, rebuildBatchInstructions, DEFAULT_FLUSH_INTERVAL_MS, type DeferredQueue, type DeferredQueueConfig, type EnqueuePendingTapInput, } from "./merchant/deferred-queue.js";
4
+ export { createInMemoryDeferredStore, deserializePendingTap, serializePendingTap, MAX_SECP256R1_SIGNATURES, MAX_TAPS_PER_TX, MAX_TRANSACTION_SIZE, type DeferredQueueStore, type PendingTap, type PendingTapWire, type WireVerifyEntry, } from "./merchant/deferred-store.js";
5
+ export { createIndexedDbDeferredStore, type IndexedDbDeferredStoreConfig, } from "./merchant/indexed-db-store.js";
6
+ export { createWalletClient, type SettingsChangeResult, type WalletClient, type WalletClientConfig, } from "./wallet/client.js";
7
+ export { createArbiterClient, type ArbiterClient, type ArbiterClientConfig, } from "./arbiter/client.js";
8
+ export { effectiveApprovedArbiter, effectiveCredentialPubkey, effectiveEnablerPubkey, effectiveMaxTapAmount, effectiveReserve, fetchEscrowBalance, fetchPaymentAccountSummary, fetchPaymentSummary, listPendingSettingsChanges, toPaymentSummary, type EscrowBalance, type PaymentAccountSummary, type PendingSettingsChange, type PaymentSummary, type SdkRpc, } from "./core/payment.js";
9
+ export { PaymentStatus, decodePaymentFlags, type DecodedPaymentFlags, } from "./core/status.js";
10
+ export { collectEventsForAddress, decodeEventData, decodeEventsFromLogs, eventDiscriminator, eventParticipants, getEventsForSignature, subscribeToPaymentEvents, type DisputeResolvedEvent, type EventWithContext, type PaymentCapturedEvent, type PaymentClosedEvent, type PaymentCreatedEvent, type PaymentDisputedEvent, type PaymentRefundedEvent, type PhygitalPaymentEvent, type PhygitalPaymentEventType, type ReserveChangedEvent, type SettledPaymentRefundedEvent, } from "./core/events.js";
11
+ export { ConfigurationError, EnablerMismatchError, EnvironmentError, InvalidAmountError, InvalidReferenceError, PhygitalPaymentSdkError, PolicyViolationError, ProgramExecutionError, ProviderHttpError, SimulationError, TapReadError, extractCustomErrorCode, programErrorName, toSdkError, } from "./core/errors.js";
12
+ export { getPhygitalPaymentErrorMessage, isPhygitalPaymentError, PHYGITAL_PAYMENT_ERROR__AUTHORIZATION_EXPIRED, PHYGITAL_PAYMENT_ERROR__AUTHORIZATION_TTL_EXCEEDED, PHYGITAL_PAYMENT_ERROR__INVALID_AMOUNT, PHYGITAL_PAYMENT_ERROR__INVALID_PAYMENT_STATUS, PHYGITAL_PAYMENT_ERROR__CAPTURE_WINDOW_NOT_ELAPSED, PHYGITAL_PAYMENT_ERROR__CAPTURE_WINDOW_ELAPSED, PHYGITAL_PAYMENT_ERROR__UNAUTHORIZED_PAYER, PHYGITAL_PAYMENT_ERROR__UNAUTHORIZED_MERCHANT, PHYGITAL_PAYMENT_ERROR__UNAUTHORIZED_ARBITER, PHYGITAL_PAYMENT_ERROR__RESOLVE_DEADLINE_NOT_MET, PHYGITAL_PAYMENT_ERROR__MERCHANT_RESPONDED, PHYGITAL_PAYMENT_ERROR__INSUFFICIENT_DISPUTE_BOND, PHYGITAL_PAYMENT_ERROR__INVALID_CONFIG_VALUE, PHYGITAL_PAYMENT_ERROR__ARBITER_NOT_CONFIGURED, PHYGITAL_PAYMENT_ERROR__ARBITER_REQUIRED, PHYGITAL_PAYMENT_ERROR__UNAUTHORIZED_RENT_PAYER, PHYGITAL_PAYMENT_ERROR__TOO_MANY_DISPUTE_STRIKES, PHYGITAL_PAYMENT_ERROR__ARBITER_DEADLINE_NOT_MET, PHYGITAL_PAYMENT_ERROR__INSUFFICIENT_AMOUNT, PHYGITAL_PAYMENT_ERROR__INVALID_REFERENCE, PHYGITAL_PAYMENT_ERROR__MISSING_INSTRUCTIONS_SYSVAR, PHYGITAL_PAYMENT_ERROR__INVALID_SECP256R1_INSTRUCTION, PHYGITAL_PAYMENT_ERROR__SIGNATURE_INDEX_OUT_OF_BOUNDS, PHYGITAL_PAYMENT_ERROR__INVALID_SIGNATURE_OFFSETS, PHYGITAL_PAYMENT_ERROR__INVALID_SECP256R1_PUBLIC_KEY, PHYGITAL_PAYMENT_ERROR__INVALID_PUBLIC_KEY, PHYGITAL_PAYMENT_ERROR__RESERVE_VIOLATED, PHYGITAL_PAYMENT_ERROR__INVALID_CREDENTIAL, PHYGITAL_PAYMENT_ERROR__UNSUPPORTED_MINT_EXTENSION, PHYGITAL_PAYMENT_ERROR__PARTIAL_REFUND_WHILE_DISPUTED, PHYGITAL_PAYMENT_ERROR__INVALID_PRE_DISPUTE_MARKER, type PhygitalPaymentError, } from "./generated/errors/phygitalPayment.js";
13
+ export { assertValidReference, buildPaymentAuthorizationMessage, buildTapChallenge, type PaymentAuthorizationFields, type TapChallengeFields, } from "./core/challenge.js";
14
+ export { clampExecuteBy, computeExecutionPlan, type ExecutionPlan, type ReserveState, type ExposureState, } from "./core/execution-plan.js";
15
+ export { deriveAssociatedTokenAddress, deriveEscrowAddress, deriveMerchantOperatorAddress, derivePaymentAccountAddress, derivePaymentAddress, derivePaymentAddressFromSeeds, } from "./core/pda.js";
16
+ export { deserializeInstructions, serializeInstructions, type WireInstruction, type WireInstructionAccount, } from "./core/instruction-codec.js";
17
+ export { createProviderTransport, isTransientProviderStatus, type EnablerCosignResult, type EnablerSignatureRequest, type EnablerSignatureResponse, type FeePayerResponse, type ProviderRetryConfig, type ProviderTransport, type ProviderTransportConfig, type SignAsFeePayerRequest, type SignAsFeePayerResponse, type TransferReceipt, } from "./core/provider-transport.js";
18
+ export { createProviderFeePayerSigner, type ProviderFeePayerSigner, } from "./core/provider-fee-payer.js";
19
+ export { PROTOCOL_CONSTANTS, autoRefundSplit, computeDisputeBond, isAutoRefundable, isDisputable, isSettleable, nextDeadline, nowSeconds, } from "./core/time.js";
20
+ export { assertU64, fromBaseUnits, toBaseUnits } from "./core/amounts.js";
21
+ export { NO_EVIDENCE, hashEvidence } from "./core/evidence.js";
22
+ export type { IndexedPayment, IndexerStore, } from "./core/indexer-store.js";
23
+ export { PHYGITAL_PAYMENT_PROGRAM_ADDRESS } from "./generated/programs/phygitalPayment.js";
24
+ export type { MerchantOperator, Payment, PaymentAccount, } from "./generated/accounts/index.js";
25
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAWA,OAAO,EACL,oBAAoB,EACpB,KAAK,cAAc,EACnB,KAAK,oBAAoB,GAC1B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,eAAe,EACf,KAAK,YAAY,EACjB,KAAK,mBAAmB,EACxB,KAAK,YAAY,EACjB,KAAK,WAAW,EAChB,KAAK,kBAAkB,GACxB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,mBAAmB,EACnB,gBAAgB,EAChB,wBAAwB,EACxB,yBAAyB,EACzB,KAAK,aAAa,EAClB,KAAK,mBAAmB,EACxB,KAAK,sBAAsB,GAC5B,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACL,2BAA2B,EAC3B,qBAAqB,EACrB,mBAAmB,EACnB,wBAAwB,EACxB,eAAe,EACf,oBAAoB,EACpB,KAAK,kBAAkB,EACvB,KAAK,UAAU,EACf,KAAK,cAAc,EACnB,KAAK,eAAe,GACrB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACL,4BAA4B,EAC5B,KAAK,4BAA4B,GAClC,MAAM,gCAAgC,CAAC;AAExC,OAAO,EACL,kBAAkB,EAClB,KAAK,oBAAoB,EACzB,KAAK,YAAY,EACjB,KAAK,kBAAkB,GACxB,MAAM,oBAAoB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B,eAAe,EACf,kBAAkB,EAClB,gBAAgB,EAChB,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,UAAU,GACX,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAC1E,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAG/D,YAAY,EACV,cAAc,EACd,YAAY,GACb,MAAM,yBAAyB,CAAC;AAGjC,OAAO,EAAE,gCAAgC,EAAE,MAAM,yCAAyC,CAAC;AAC3F,YAAY,EACV,gBAAgB,EAChB,OAAO,EACP,cAAc,GACf,MAAM,+BAA+B,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,23 @@
1
+ export { createMerchantClient, } from "./merchant/client.js";
2
+ export { CosignLandError, } from "./merchant/charge.js";
3
+ export { createDeferredQueue, packTapsForBatch, rebuildBatchInstructions, DEFAULT_FLUSH_INTERVAL_MS, } from "./merchant/deferred-queue.js";
4
+ export { createInMemoryDeferredStore, deserializePendingTap, serializePendingTap, MAX_SECP256R1_SIGNATURES, MAX_TAPS_PER_TX, MAX_TRANSACTION_SIZE, } from "./merchant/deferred-store.js";
5
+ export { createIndexedDbDeferredStore, } from "./merchant/indexed-db-store.js";
6
+ export { createWalletClient, } from "./wallet/client.js";
7
+ export { createArbiterClient, } from "./arbiter/client.js";
8
+ export { effectiveApprovedArbiter, effectiveCredentialPubkey, effectiveEnablerPubkey, effectiveMaxTapAmount, effectiveReserve, fetchEscrowBalance, fetchPaymentAccountSummary, fetchPaymentSummary, listPendingSettingsChanges, toPaymentSummary, } from "./core/payment.js";
9
+ export { PaymentStatus, decodePaymentFlags, } from "./core/status.js";
10
+ export { collectEventsForAddress, decodeEventData, decodeEventsFromLogs, eventDiscriminator, eventParticipants, getEventsForSignature, subscribeToPaymentEvents, } from "./core/events.js";
11
+ export { ConfigurationError, EnablerMismatchError, EnvironmentError, InvalidAmountError, InvalidReferenceError, PhygitalPaymentSdkError, PolicyViolationError, ProgramExecutionError, ProviderHttpError, SimulationError, TapReadError, extractCustomErrorCode, programErrorName, toSdkError, } from "./core/errors.js";
12
+ export { getPhygitalPaymentErrorMessage, isPhygitalPaymentError, PHYGITAL_PAYMENT_ERROR__AUTHORIZATION_EXPIRED, PHYGITAL_PAYMENT_ERROR__AUTHORIZATION_TTL_EXCEEDED, PHYGITAL_PAYMENT_ERROR__INVALID_AMOUNT, PHYGITAL_PAYMENT_ERROR__INVALID_PAYMENT_STATUS, PHYGITAL_PAYMENT_ERROR__CAPTURE_WINDOW_NOT_ELAPSED, PHYGITAL_PAYMENT_ERROR__CAPTURE_WINDOW_ELAPSED, PHYGITAL_PAYMENT_ERROR__UNAUTHORIZED_PAYER, PHYGITAL_PAYMENT_ERROR__UNAUTHORIZED_MERCHANT, PHYGITAL_PAYMENT_ERROR__UNAUTHORIZED_ARBITER, PHYGITAL_PAYMENT_ERROR__RESOLVE_DEADLINE_NOT_MET, PHYGITAL_PAYMENT_ERROR__MERCHANT_RESPONDED, PHYGITAL_PAYMENT_ERROR__INSUFFICIENT_DISPUTE_BOND, PHYGITAL_PAYMENT_ERROR__INVALID_CONFIG_VALUE, PHYGITAL_PAYMENT_ERROR__ARBITER_NOT_CONFIGURED, PHYGITAL_PAYMENT_ERROR__ARBITER_REQUIRED, PHYGITAL_PAYMENT_ERROR__UNAUTHORIZED_RENT_PAYER, PHYGITAL_PAYMENT_ERROR__TOO_MANY_DISPUTE_STRIKES, PHYGITAL_PAYMENT_ERROR__ARBITER_DEADLINE_NOT_MET, PHYGITAL_PAYMENT_ERROR__INSUFFICIENT_AMOUNT, PHYGITAL_PAYMENT_ERROR__INVALID_REFERENCE, PHYGITAL_PAYMENT_ERROR__MISSING_INSTRUCTIONS_SYSVAR, PHYGITAL_PAYMENT_ERROR__INVALID_SECP256R1_INSTRUCTION, PHYGITAL_PAYMENT_ERROR__SIGNATURE_INDEX_OUT_OF_BOUNDS, PHYGITAL_PAYMENT_ERROR__INVALID_SIGNATURE_OFFSETS, PHYGITAL_PAYMENT_ERROR__INVALID_SECP256R1_PUBLIC_KEY, PHYGITAL_PAYMENT_ERROR__INVALID_PUBLIC_KEY, PHYGITAL_PAYMENT_ERROR__RESERVE_VIOLATED, PHYGITAL_PAYMENT_ERROR__INVALID_CREDENTIAL, PHYGITAL_PAYMENT_ERROR__UNSUPPORTED_MINT_EXTENSION, PHYGITAL_PAYMENT_ERROR__PARTIAL_REFUND_WHILE_DISPUTED, PHYGITAL_PAYMENT_ERROR__INVALID_PRE_DISPUTE_MARKER, } from "./generated/errors/phygitalPayment.js";
13
+ export { assertValidReference, buildPaymentAuthorizationMessage, buildTapChallenge, } from "./core/challenge.js";
14
+ export { clampExecuteBy, computeExecutionPlan, } from "./core/execution-plan.js";
15
+ export { deriveAssociatedTokenAddress, deriveEscrowAddress, deriveMerchantOperatorAddress, derivePaymentAccountAddress, derivePaymentAddress, derivePaymentAddressFromSeeds, } from "./core/pda.js";
16
+ export { deserializeInstructions, serializeInstructions, } from "./core/instruction-codec.js";
17
+ export { createProviderTransport, isTransientProviderStatus, } from "./core/provider-transport.js";
18
+ export { createProviderFeePayerSigner, } from "./core/provider-fee-payer.js";
19
+ export { PROTOCOL_CONSTANTS, autoRefundSplit, computeDisputeBond, isAutoRefundable, isDisputable, isSettleable, nextDeadline, nowSeconds, } from "./core/time.js";
20
+ export { assertU64, fromBaseUnits, toBaseUnits } from "./core/amounts.js";
21
+ export { NO_EVIDENCE, hashEvidence } from "./core/evidence.js";
22
+ export { PHYGITAL_PAYMENT_PROGRAM_ADDRESS } from "./generated/programs/phygitalPayment.js";
23
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAWA,OAAO,EACL,oBAAoB,GAGrB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,eAAe,GAMhB,MAAM,sBAAsB,CAAC;AAC9B,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C5C,8CAA8C,EAC9C,wCAAwC,EACxC,+CAA+C,EAC/C,gDAAgD,EAChD,gDAAgD,EAChD,2CAA2C,EAC3C,yCAAyC,EACzC,mDAAmD,EACnD,qDAAqD,EACrD,qDAAqD,EACrD,iDAAiD,EACjD,oDAAoD,EACpD,0CAA0C,EAC1C,wCAAwC,EACxC,0CAA0C,EAC1C,kDAAkD,EAClD,qDAAqD,EACrD,kDAAkD,GAEnD,MAAM,uCAAuC,CAAC;AAG/C,OAAO,EACL,oBAAoB,EACpB,gCAAgC,EAChC,iBAAiB,GAGlB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,cAAc,EACd,oBAAoB,GAIrB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,4BAA4B,EAC5B,mBAAmB,EACnB,6BAA6B,EAC7B,2BAA2B,EAC3B,oBAAoB,EACpB,6BAA6B,GAC9B,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,uBAAuB,EACvB,qBAAqB,GAGtB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,uBAAuB,EACvB,yBAAyB,GAW1B,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACL,4BAA4B,GAE7B,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACL,kBAAkB,EAClB,eAAe,EACf,kBAAkB,EAClB,gBAAgB,EAChB,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,UAAU,GACX,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAC1E,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAS/D,OAAO,EAAE,gCAAgC,EAAE,MAAM,yCAAyC,CAAC"}
@@ -0,0 +1,106 @@
1
+ import { type Address, type Signature, type TransactionSigner } from "@solana/kit";
2
+ import { type Secp256r1VerifyEntry } from "phygital-token-sdk";
3
+ import { PhygitalPaymentSdkError } from "../core/errors.js";
4
+ import { type ConfigChangeState, type ExecutionPlan, type ExposureState, type ReserveState } from "../core/execution-plan.js";
5
+ import { type ArbiterReputation, type SdkRpc } from "../core/payment.js";
6
+ import type { ProviderTransport } from "../core/provider-transport.js";
7
+ import type { TransactionRuntime } from "../core/transactions.js";
8
+ import type { DeferredQueue } from "./deferred-queue.js";
9
+ export type ChargeProgressEvent = {
10
+ phase: "awaitingTap";
11
+ } | {
12
+ phase: "credentialRead";
13
+ credentialId: string;
14
+ } | {
15
+ phase: "verifying";
16
+ } | {
17
+ phase: "simulating";
18
+ } | {
19
+ phase: "submitting";
20
+ plan: ExecutionPlan;
21
+ } | {
22
+ phase: "queued";
23
+ queueId: string;
24
+ executeBy: number;
25
+ } | {
26
+ phase: "confirmed";
27
+ signature: Signature;
28
+ } | {
29
+ phase: "receiptPersistFailed";
30
+ error: unknown;
31
+ };
32
+ export interface AcceptArbiterInfo {
33
+ arbiter: Address;
34
+ reputation: ArbiterReputation | null;
35
+ }
36
+ export interface ChargeParams {
37
+ amount: bigint;
38
+ mint: Address;
39
+ acceptArbiter?: (info: AcceptArbiterInfo) => boolean | Promise<boolean>;
40
+ reference?: Uint8Array;
41
+ issuedAt?: number;
42
+ onProgress?: (event: ChargeProgressEvent) => void;
43
+ abortSignal?: AbortSignal;
44
+ allowDeferral?: boolean;
45
+ }
46
+ export type ChargeResult = {
47
+ kind: "confirmed";
48
+ signature: Signature;
49
+ payment: Address;
50
+ reference: Uint8Array;
51
+ payer: Address;
52
+ } | {
53
+ kind: "queued";
54
+ queueId: string;
55
+ executeBy: number;
56
+ payment: Address;
57
+ reference: Uint8Array;
58
+ payer: Address;
59
+ };
60
+ export interface CosignedTap {
61
+ reference: Uint8Array;
62
+ issuedAt: number;
63
+ amount: bigint;
64
+ mint: Address;
65
+ arbiter: Address;
66
+ payer: Address;
67
+ merchant: Address;
68
+ tokenProgram: Address;
69
+ paymentAccessory: Uint8Array;
70
+ credentialEntry: Secp256r1VerifyEntry;
71
+ enablerEntry: Secp256r1VerifyEntry;
72
+ clientDataJson: Uint8Array;
73
+ asset: Address;
74
+ paymentAccount: Address;
75
+ payment: Address;
76
+ escrowTokenAccount: Address;
77
+ reserve: ReserveState;
78
+ config: ConfigChangeState;
79
+ exposure: ExposureState;
80
+ }
81
+ export declare class CosignLandError extends PhygitalPaymentSdkError {
82
+ readonly code = "cosign_land_failed";
83
+ readonly cosigned: CosignedTap;
84
+ constructor(message: string, cosigned: CosignedTap, options?: {
85
+ cause?: unknown;
86
+ });
87
+ }
88
+ export interface ChargeContext {
89
+ rpc: SdkRpc;
90
+ runtime: TransactionRuntime;
91
+ provider: ProviderTransport;
92
+ merchant: Address;
93
+ feePayer: TransactionSigner;
94
+ tokenProgram: Address;
95
+ deferredQueue?: DeferredQueue;
96
+ rpId?: string;
97
+ allowDeferral?: boolean;
98
+ }
99
+ export interface ResumeChargeParams {
100
+ onProgress?: (event: ChargeProgressEvent) => void;
101
+ allowDeferral?: boolean;
102
+ }
103
+ export declare function resumeCharge(ctx: ChargeContext, cosigned: CosignedTap, params?: ResumeChargeParams): Promise<ChargeResult>;
104
+ export declare function charge(ctx: ChargeContext, params: ChargeParams): Promise<ChargeResult>;
105
+ export declare const DEFAULT_TOKEN_PROGRAM: Address<"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA">;
106
+ //# sourceMappingURL=charge.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"charge.d.ts","sourceRoot":"","sources":["../../src/merchant/charge.ts"],"names":[],"mappings":"AA6BA,OAAO,EAEL,KAAK,OAAO,EAEZ,KAAK,SAAS,EACd,KAAK,iBAAiB,EACvB,MAAM,aAAa,CAAC;AACrB,OAAO,EAKL,KAAK,oBAAoB,EAC1B,MAAM,oBAAoB,CAAC;AAY5B,OAAO,EAML,uBAAuB,EACxB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAEL,KAAK,iBAAiB,EACtB,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,KAAK,YAAY,E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