@virtuals-protocol/acp-node-v2 0.1.3 → 0.1.4
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.
- package/dist/clientFactory.d.ts +1 -2
- package/dist/clientFactory.d.ts.map +1 -1
- package/dist/clientFactory.js +1 -5
- package/dist/clientFactory.js.map +1 -1
- package/dist/core/constants.d.ts +4 -0
- package/dist/core/constants.d.ts.map +1 -1
- package/dist/core/constants.js +13 -0
- package/dist/core/constants.js.map +1 -1
- package/dist/core/solana/constants.d.ts +5 -0
- package/dist/core/solana/constants.d.ts.map +1 -0
- package/dist/core/solana/constants.js +5 -0
- package/dist/core/solana/constants.js.map +1 -0
- package/dist/core/solana/generated/acp/accounts/acpState.d.ts +60 -0
- package/dist/core/solana/generated/acp/accounts/acpState.d.ts.map +1 -0
- package/dist/core/solana/generated/acp/accounts/acpState.js +68 -0
- package/dist/core/solana/generated/acp/accounts/acpState.js.map +1 -0
- package/dist/core/solana/generated/acp/accounts/hookWhitelist.d.ts +37 -0
- package/dist/core/solana/generated/acp/accounts/hookWhitelist.d.ts.map +1 -0
- package/dist/core/solana/generated/acp/accounts/hookWhitelist.js +59 -0
- package/dist/core/solana/generated/acp/accounts/hookWhitelist.js.map +1 -0
- package/dist/core/solana/generated/acp/accounts/index.d.ts +11 -0
- package/dist/core/solana/generated/acp/accounts/index.d.ts.map +1 -0
- package/dist/core/solana/generated/acp/accounts/index.js +11 -0
- package/dist/core/solana/generated/acp/accounts/index.js.map +1 -0
- package/dist/core/solana/generated/acp/accounts/job.d.ts +89 -0
- package/dist/core/solana/generated/acp/accounts/job.d.ts.map +1 -0
- package/dist/core/solana/generated/acp/accounts/job.js +83 -0
- package/dist/core/solana/generated/acp/accounts/job.js.map +1 -0
- package/dist/core/solana/generated/acp/errors/agenticCommerceV3.d.ts +94 -0
- package/dist/core/solana/generated/acp/errors/agenticCommerceV3.d.ts.map +1 -0
- package/dist/core/solana/generated/acp/errors/agenticCommerceV3.js +135 -0
- package/dist/core/solana/generated/acp/errors/agenticCommerceV3.js.map +1 -0
- package/dist/core/solana/generated/acp/errors/index.d.ts +9 -0
- package/dist/core/solana/generated/acp/errors/index.d.ts.map +1 -0
- package/dist/core/solana/generated/acp/errors/index.js +9 -0
- package/dist/core/solana/generated/acp/errors/index.js.map +1 -0
- package/dist/core/solana/generated/acp/index.d.ts +14 -0
- package/dist/core/solana/generated/acp/index.d.ts.map +1 -0
- package/dist/core/solana/generated/acp/index.js +14 -0
- package/dist/core/solana/generated/acp/index.js.map +1 -0
- package/dist/core/solana/generated/acp/instructions/acceptAuthority.d.ts +47 -0
- package/dist/core/solana/generated/acp/instructions/acceptAuthority.d.ts.map +1 -0
- package/dist/core/solana/generated/acp/instructions/acceptAuthority.js +88 -0
- package/dist/core/solana/generated/acp/instructions/acceptAuthority.js.map +1 -0
- package/dist/core/solana/generated/acp/instructions/addHookWhitelist.d.ts +64 -0
- package/dist/core/solana/generated/acp/instructions/addHookWhitelist.d.ts.map +1 -0
- package/dist/core/solana/generated/acp/instructions/addHookWhitelist.js +140 -0
- package/dist/core/solana/generated/acp/instructions/addHookWhitelist.js.map +1 -0
- package/dist/core/solana/generated/acp/instructions/claimRefund.d.ts +74 -0
- package/dist/core/solana/generated/acp/instructions/claimRefund.d.ts.map +1 -0
- package/dist/core/solana/generated/acp/instructions/claimRefund.js +142 -0
- package/dist/core/solana/generated/acp/instructions/claimRefund.js.map +1 -0
- package/dist/core/solana/generated/acp/instructions/complete.d.ts +108 -0
- package/dist/core/solana/generated/acp/instructions/complete.d.ts.map +1 -0
- package/dist/core/solana/generated/acp/instructions/complete.js +190 -0
- package/dist/core/solana/generated/acp/instructions/complete.js.map +1 -0
- package/dist/core/solana/generated/acp/instructions/createJob.d.ts +83 -0
- package/dist/core/solana/generated/acp/instructions/createJob.d.ts.map +1 -0
- package/dist/core/solana/generated/acp/instructions/createJob.js +137 -0
- package/dist/core/solana/generated/acp/instructions/createJob.js.map +1 -0
- package/dist/core/solana/generated/acp/instructions/fund.d.ts +99 -0
- package/dist/core/solana/generated/acp/instructions/fund.d.ts.map +1 -0
- package/dist/core/solana/generated/acp/instructions/fund.js +126 -0
- package/dist/core/solana/generated/acp/instructions/fund.js.map +1 -0
- package/dist/core/solana/generated/acp/instructions/index.d.ts +23 -0
- package/dist/core/solana/generated/acp/instructions/index.d.ts.map +1 -0
- package/dist/core/solana/generated/acp/instructions/index.js +23 -0
- package/dist/core/solana/generated/acp/instructions/index.js.map +1 -0
- package/dist/core/solana/generated/acp/instructions/initialize.d.ts +76 -0
- package/dist/core/solana/generated/acp/instructions/initialize.d.ts.map +1 -0
- package/dist/core/solana/generated/acp/instructions/initialize.js +141 -0
- package/dist/core/solana/generated/acp/instructions/initialize.js.map +1 -0
- package/dist/core/solana/generated/acp/instructions/nominateAuthority.d.ts +52 -0
- package/dist/core/solana/generated/acp/instructions/nominateAuthority.d.ts.map +1 -0
- package/dist/core/solana/generated/acp/instructions/nominateAuthority.js +96 -0
- package/dist/core/solana/generated/acp/instructions/nominateAuthority.js.map +1 -0
- package/dist/core/solana/generated/acp/instructions/reject.d.ts +88 -0
- package/dist/core/solana/generated/acp/instructions/reject.d.ts.map +1 -0
- package/dist/core/solana/generated/acp/instructions/reject.js +168 -0
- package/dist/core/solana/generated/acp/instructions/reject.js.map +1 -0
- package/dist/core/solana/generated/acp/instructions/removeHookWhitelist.d.ts +56 -0
- package/dist/core/solana/generated/acp/instructions/removeHookWhitelist.d.ts.map +1 -0
- package/dist/core/solana/generated/acp/instructions/removeHookWhitelist.js +112 -0
- package/dist/core/solana/generated/acp/instructions/removeHookWhitelist.js.map +1 -0
- package/dist/core/solana/generated/acp/instructions/setBudget.d.ts +56 -0
- package/dist/core/solana/generated/acp/instructions/setBudget.d.ts.map +1 -0
- package/dist/core/solana/generated/acp/instructions/setBudget.js +90 -0
- package/dist/core/solana/generated/acp/instructions/setBudget.js.map +1 -0
- package/dist/core/solana/generated/acp/instructions/setEvaluatorFee.d.ts +52 -0
- package/dist/core/solana/generated/acp/instructions/setEvaluatorFee.d.ts.map +1 -0
- package/dist/core/solana/generated/acp/instructions/setEvaluatorFee.js +96 -0
- package/dist/core/solana/generated/acp/instructions/setEvaluatorFee.js.map +1 -0
- package/dist/core/solana/generated/acp/instructions/setPlatformFee.d.ts +56 -0
- package/dist/core/solana/generated/acp/instructions/setPlatformFee.d.ts.map +1 -0
- package/dist/core/solana/generated/acp/instructions/setPlatformFee.js +98 -0
- package/dist/core/solana/generated/acp/instructions/setPlatformFee.js.map +1 -0
- package/dist/core/solana/generated/acp/instructions/setProvider.d.ts +50 -0
- package/dist/core/solana/generated/acp/instructions/setProvider.d.ts.map +1 -0
- package/dist/core/solana/generated/acp/instructions/setProvider.js +85 -0
- package/dist/core/solana/generated/acp/instructions/setProvider.js.map +1 -0
- package/dist/core/solana/generated/acp/instructions/submit.d.ts +150 -0
- package/dist/core/solana/generated/acp/instructions/submit.d.ts.map +1 -0
- package/dist/core/solana/generated/acp/instructions/submit.js +214 -0
- package/dist/core/solana/generated/acp/instructions/submit.js.map +1 -0
- package/dist/core/solana/generated/acp/pdas/acpState.d.ts +12 -0
- package/dist/core/solana/generated/acp/pdas/acpState.d.ts.map +1 -0
- package/dist/core/solana/generated/acp/pdas/acpState.js +18 -0
- package/dist/core/solana/generated/acp/pdas/acpState.js.map +1 -0
- package/dist/core/solana/generated/acp/pdas/hookWhitelist.d.ts +15 -0
- package/dist/core/solana/generated/acp/pdas/hookWhitelist.d.ts.map +1 -0
- package/dist/core/solana/generated/acp/pdas/hookWhitelist.js +21 -0
- package/dist/core/solana/generated/acp/pdas/hookWhitelist.js.map +1 -0
- package/dist/core/solana/generated/acp/pdas/index.d.ts +10 -0
- package/dist/core/solana/generated/acp/pdas/index.d.ts.map +1 -0
- package/dist/core/solana/generated/acp/pdas/index.js +10 -0
- package/dist/core/solana/generated/acp/pdas/index.js.map +1 -0
- package/dist/core/solana/generated/acp/programs/agenticCommerceV3.d.ts +71 -0
- package/dist/core/solana/generated/acp/programs/agenticCommerceV3.d.ts.map +1 -0
- package/dist/core/solana/generated/acp/programs/agenticCommerceV3.js +209 -0
- package/dist/core/solana/generated/acp/programs/agenticCommerceV3.js.map +1 -0
- package/dist/core/solana/generated/acp/programs/index.d.ts +9 -0
- package/dist/core/solana/generated/acp/programs/index.d.ts.map +1 -0
- package/dist/core/solana/generated/acp/programs/index.js +9 -0
- package/dist/core/solana/generated/acp/programs/index.js.map +1 -0
- package/dist/core/solana/generated/acp/shared/index.d.ts +50 -0
- package/dist/core/solana/generated/acp/shared/index.d.ts.map +1 -0
- package/dist/core/solana/generated/acp/shared/index.js +87 -0
- package/dist/core/solana/generated/acp/shared/index.js.map +1 -0
- package/dist/core/solana/generated/acp/types/index.d.ts +9 -0
- package/dist/core/solana/generated/acp/types/index.d.ts.map +1 -0
- package/dist/core/solana/generated/acp/types/index.js +9 -0
- package/dist/core/solana/generated/acp/types/index.js.map +1 -0
- package/dist/core/solana/generated/acp/types/jobCreated.d.ts +11 -0
- package/dist/core/solana/generated/acp/types/jobCreated.d.ts.map +1 -0
- package/dist/core/solana/generated/acp/types/jobCreated.js +12 -0
- package/dist/core/solana/generated/acp/types/jobCreated.js.map +1 -0
- package/dist/core/solana/generated/acp/types/jobState.d.ts +27 -0
- package/dist/core/solana/generated/acp/types/jobState.d.ts.map +1 -0
- package/dist/core/solana/generated/acp/types/jobState.js +33 -0
- package/dist/core/solana/generated/acp/types/jobState.js.map +1 -0
- package/dist/core/solana/generated/fund-transfer-hook/accounts/fundRequestIntentId.d.ts +35 -0
- package/dist/core/solana/generated/fund-transfer-hook/accounts/fundRequestIntentId.d.ts.map +1 -0
- package/dist/core/solana/generated/fund-transfer-hook/accounts/fundRequestIntentId.js +64 -0
- package/dist/core/solana/generated/fund-transfer-hook/accounts/fundRequestIntentId.js.map +1 -0
- package/dist/core/solana/generated/fund-transfer-hook/accounts/hookMetadata.d.ts +33 -0
- package/dist/core/solana/generated/fund-transfer-hook/accounts/hookMetadata.d.ts.map +1 -0
- package/dist/core/solana/generated/fund-transfer-hook/accounts/hookMetadata.js +59 -0
- package/dist/core/solana/generated/fund-transfer-hook/accounts/hookMetadata.js.map +1 -0
- package/dist/core/solana/generated/fund-transfer-hook/accounts/hookState.d.ts +38 -0
- package/dist/core/solana/generated/fund-transfer-hook/accounts/hookState.d.ts.map +1 -0
- package/dist/core/solana/generated/fund-transfer-hook/accounts/hookState.js +62 -0
- package/dist/core/solana/generated/fund-transfer-hook/accounts/hookState.js.map +1 -0
- package/dist/core/solana/generated/fund-transfer-hook/accounts/index.d.ts +13 -0
- package/dist/core/solana/generated/fund-transfer-hook/accounts/index.d.ts.map +1 -0
- package/dist/core/solana/generated/fund-transfer-hook/accounts/index.js +13 -0
- package/dist/core/solana/generated/fund-transfer-hook/accounts/index.js.map +1 -0
- package/dist/core/solana/generated/fund-transfer-hook/accounts/intent.d.ts +61 -0
- package/dist/core/solana/generated/fund-transfer-hook/accounts/intent.d.ts.map +1 -0
- package/dist/core/solana/generated/fund-transfer-hook/accounts/intent.js +77 -0
- package/dist/core/solana/generated/fund-transfer-hook/accounts/intent.js.map +1 -0
- package/dist/core/solana/generated/fund-transfer-hook/accounts/providerEscrowIntentId.d.ts +35 -0
- package/dist/core/solana/generated/fund-transfer-hook/accounts/providerEscrowIntentId.d.ts.map +1 -0
- package/dist/core/solana/generated/fund-transfer-hook/accounts/providerEscrowIntentId.js +64 -0
- package/dist/core/solana/generated/fund-transfer-hook/accounts/providerEscrowIntentId.js.map +1 -0
- package/dist/core/solana/generated/fund-transfer-hook/index.d.ts +12 -0
- package/dist/core/solana/generated/fund-transfer-hook/index.d.ts.map +1 -0
- package/dist/core/solana/generated/fund-transfer-hook/index.js +12 -0
- package/dist/core/solana/generated/fund-transfer-hook/index.js.map +1 -0
- package/dist/core/solana/generated/fund-transfer-hook/instructions/acceptAuthority.d.ts +47 -0
- package/dist/core/solana/generated/fund-transfer-hook/instructions/acceptAuthority.d.ts.map +1 -0
- package/dist/core/solana/generated/fund-transfer-hook/instructions/acceptAuthority.js +88 -0
- package/dist/core/solana/generated/fund-transfer-hook/instructions/acceptAuthority.js.map +1 -0
- package/dist/core/solana/generated/fund-transfer-hook/instructions/afterAction.d.ts +56 -0
- package/dist/core/solana/generated/fund-transfer-hook/instructions/afterAction.d.ts.map +1 -0
- package/dist/core/solana/generated/fund-transfer-hook/instructions/afterAction.js +92 -0
- package/dist/core/solana/generated/fund-transfer-hook/instructions/afterAction.js.map +1 -0
- package/dist/core/solana/generated/fund-transfer-hook/instructions/beforeAction.d.ts +52 -0
- package/dist/core/solana/generated/fund-transfer-hook/instructions/beforeAction.d.ts.map +1 -0
- package/dist/core/solana/generated/fund-transfer-hook/instructions/beforeAction.js +90 -0
- package/dist/core/solana/generated/fund-transfer-hook/instructions/beforeAction.js.map +1 -0
- package/dist/core/solana/generated/fund-transfer-hook/instructions/claimEscrowRefund.d.ts +86 -0
- package/dist/core/solana/generated/fund-transfer-hook/instructions/claimEscrowRefund.d.ts.map +1 -0
- package/dist/core/solana/generated/fund-transfer-hook/instructions/claimEscrowRefund.js +169 -0
- package/dist/core/solana/generated/fund-transfer-hook/instructions/claimEscrowRefund.js.map +1 -0
- package/dist/core/solana/generated/fund-transfer-hook/instructions/closeIntent.d.ts +114 -0
- package/dist/core/solana/generated/fund-transfer-hook/instructions/closeIntent.d.ts.map +1 -0
- package/dist/core/solana/generated/fund-transfer-hook/instructions/closeIntent.js +120 -0
- package/dist/core/solana/generated/fund-transfer-hook/instructions/closeIntent.js.map +1 -0
- package/dist/core/solana/generated/fund-transfer-hook/instructions/index.d.ts +15 -0
- package/dist/core/solana/generated/fund-transfer-hook/instructions/index.d.ts.map +1 -0
- package/dist/core/solana/generated/fund-transfer-hook/instructions/index.js +15 -0
- package/dist/core/solana/generated/fund-transfer-hook/instructions/index.js.map +1 -0
- package/dist/core/solana/generated/fund-transfer-hook/instructions/initialize.d.ts +67 -0
- package/dist/core/solana/generated/fund-transfer-hook/instructions/initialize.d.ts.map +1 -0
- package/dist/core/solana/generated/fund-transfer-hook/instructions/initialize.js +138 -0
- package/dist/core/solana/generated/fund-transfer-hook/instructions/initialize.js.map +1 -0
- package/dist/core/solana/generated/fund-transfer-hook/instructions/nominateAuthority.d.ts +52 -0
- package/dist/core/solana/generated/fund-transfer-hook/instructions/nominateAuthority.d.ts.map +1 -0
- package/dist/core/solana/generated/fund-transfer-hook/instructions/nominateAuthority.js +96 -0
- package/dist/core/solana/generated/fund-transfer-hook/instructions/nominateAuthority.js.map +1 -0
- package/dist/core/solana/generated/fund-transfer-hook/pdas/escrowAuthority.d.ts +15 -0
- package/dist/core/solana/generated/fund-transfer-hook/pdas/escrowAuthority.d.ts.map +1 -0
- package/dist/core/solana/generated/fund-transfer-hook/pdas/escrowAuthority.js +22 -0
- package/dist/core/solana/generated/fund-transfer-hook/pdas/escrowAuthority.js.map +1 -0
- package/dist/core/solana/generated/fund-transfer-hook/pdas/hookMetadata.d.ts +12 -0
- package/dist/core/solana/generated/fund-transfer-hook/pdas/hookMetadata.d.ts.map +1 -0
- package/dist/core/solana/generated/fund-transfer-hook/pdas/hookMetadata.js +20 -0
- package/dist/core/solana/generated/fund-transfer-hook/pdas/hookMetadata.js.map +1 -0
- package/dist/core/solana/generated/fund-transfer-hook/pdas/hookState.d.ts +12 -0
- package/dist/core/solana/generated/fund-transfer-hook/pdas/hookState.d.ts.map +1 -0
- package/dist/core/solana/generated/fund-transfer-hook/pdas/hookState.js +18 -0
- package/dist/core/solana/generated/fund-transfer-hook/pdas/hookState.js.map +1 -0
- package/dist/core/solana/generated/fund-transfer-hook/pdas/index.d.ts +13 -0
- package/dist/core/solana/generated/fund-transfer-hook/pdas/index.d.ts.map +1 -0
- package/dist/core/solana/generated/fund-transfer-hook/pdas/index.js +13 -0
- package/dist/core/solana/generated/fund-transfer-hook/pdas/index.js.map +1 -0
- package/dist/core/solana/generated/fund-transfer-hook/pdas/intent.d.ts +15 -0
- package/dist/core/solana/generated/fund-transfer-hook/pdas/intent.d.ts.map +1 -0
- package/dist/core/solana/generated/fund-transfer-hook/pdas/intent.js +19 -0
- package/dist/core/solana/generated/fund-transfer-hook/pdas/intent.js.map +1 -0
- package/dist/core/solana/generated/fund-transfer-hook/pdas/providerEscrowIntentId.d.ts +15 -0
- package/dist/core/solana/generated/fund-transfer-hook/pdas/providerEscrowIntentId.d.ts.map +1 -0
- package/dist/core/solana/generated/fund-transfer-hook/pdas/providerEscrowIntentId.js +22 -0
- package/dist/core/solana/generated/fund-transfer-hook/pdas/providerEscrowIntentId.js.map +1 -0
- package/dist/core/solana/generated/fund-transfer-hook/programs/fundTransferHook.d.ts +49 -0
- package/dist/core/solana/generated/fund-transfer-hook/programs/fundTransferHook.d.ts.map +1 -0
- package/dist/core/solana/generated/fund-transfer-hook/programs/fundTransferHook.js +129 -0
- package/dist/core/solana/generated/fund-transfer-hook/programs/fundTransferHook.js.map +1 -0
- package/dist/core/solana/generated/fund-transfer-hook/programs/index.d.ts +9 -0
- package/dist/core/solana/generated/fund-transfer-hook/programs/index.d.ts.map +1 -0
- package/dist/core/solana/generated/fund-transfer-hook/programs/index.js +9 -0
- package/dist/core/solana/generated/fund-transfer-hook/programs/index.js.map +1 -0
- package/dist/core/solana/generated/fund-transfer-hook/shared/index.d.ts +50 -0
- package/dist/core/solana/generated/fund-transfer-hook/shared/index.d.ts.map +1 -0
- package/dist/core/solana/generated/fund-transfer-hook/shared/index.js +87 -0
- package/dist/core/solana/generated/fund-transfer-hook/shared/index.js.map +1 -0
- package/dist/core/solana/wallet.d.ts +49 -0
- package/dist/core/solana/wallet.d.ts.map +1 -0
- package/dist/core/solana/wallet.js +119 -0
- package/dist/core/solana/wallet.js.map +1 -0
- package/dist/events/socketTransport.d.ts +18 -0
- package/dist/events/socketTransport.d.ts.map +1 -0
- package/dist/events/socketTransport.js +117 -0
- package/dist/events/socketTransport.js.map +1 -0
- package/dist/index.d.ts +4 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -1
- package/dist/index.js.map +1 -1
- package/dist/providers/evm/privyAlchemyEvmProviderAdapter.js +1 -1
- package/dist/providers/evm/privyAlchemyEvmProviderAdapter.js.map +1 -1
- package/dist/providers/providerAuthClient.d.ts +8 -2
- package/dist/providers/providerAuthClient.d.ts.map +1 -1
- package/dist/providers/providerAuthClient.js +6 -12
- package/dist/providers/providerAuthClient.js.map +1 -1
- package/dist/providers/solana/keypairSolanaProviderAdapter.d.ts +16 -0
- package/dist/providers/solana/keypairSolanaProviderAdapter.d.ts.map +1 -0
- package/dist/providers/solana/keypairSolanaProviderAdapter.js +68 -0
- package/dist/providers/solana/keypairSolanaProviderAdapter.js.map +1 -0
- package/dist/providers/solana/privySolanaProviderAdapter.d.ts +54 -0
- package/dist/providers/solana/privySolanaProviderAdapter.d.ts.map +1 -0
- package/dist/providers/solana/privySolanaProviderAdapter.js +357 -0
- package/dist/providers/solana/privySolanaProviderAdapter.js.map +1 -0
- package/dist/providers/solana/solanaProviderAdapter.d.ts +5 -1
- package/dist/providers/solana/solanaProviderAdapter.d.ts.map +1 -1
- package/dist/providers/solana/solanaProviderAdapter.js +17 -1
- package/dist/providers/solana/solanaProviderAdapter.js.map +1 -1
- package/dist/providers/types.d.ts +11 -6
- package/dist/providers/types.d.ts.map +1 -1
- package/dist/providers/types.js +1 -1
- package/dist/providers/types.js.map +1 -1
- package/package.json +3 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fundTransferHook.d.ts","sourceRoot":"","sources":["../../../../../../src/core/solana/generated/fund-transfer-hook/programs/fundTransferHook.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAKL,KAAK,OAAO,EACZ,KAAK,WAAW,EAChB,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,EACxB,MAAM,aAAa,CAAC;AACrB,OAAO,EAQL,KAAK,gCAAgC,EACrC,KAAK,4BAA4B,EACjC,KAAK,6BAA6B,EAClC,KAAK,kCAAkC,EACvC,KAAK,4BAA4B,EACjC,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C,eAAe,EAAE,2BAA2B,CAAC,UAAU,CAAC;CACzD,GAAG,2BAA2B,CAAC,QAAQ,CAAC,CAAC,GAC1C,CAAC;IACC,eAAe,EAAE,2BAA2B,CAAC,iBAAiB,CAAC;CAChE,GAAG,kCAAkC,CAAC,QAAQ,CAAC,CAAC,CAAC;AAEtD,wBAAgB,gCAAgC,CAAC,QAAQ,SAAS,MAAM,EACtE,WAAW,EAAE,WAAW,CAAC,QAAQ,CAAC,GAAG,mBAAmB,CAAC,kBAAkB,CAAC,GAC3E,iCAAiC,CAAC,QAAQ,CAAC,CAyD7C"}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was AUTOGENERATED using the Codama library.
|
|
3
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
4
|
+
* to add features, then rerun Codama to update it.
|
|
5
|
+
*
|
|
6
|
+
* @see https://github.com/codama-idl/codama
|
|
7
|
+
*/
|
|
8
|
+
import { assertIsInstructionWithAccounts, containsBytes, fixEncoderSize, getBytesEncoder, } from "@solana/kit";
|
|
9
|
+
import { parseAcceptAuthorityInstruction, parseAfterActionInstruction, parseBeforeActionInstruction, parseClaimEscrowRefundInstruction, parseCloseIntentInstruction, parseInitializeInstruction, parseNominateAuthorityInstruction, } from "../instructions/index.js";
|
|
10
|
+
export const FUND_TRANSFER_HOOK_PROGRAM_ADDRESS = "9gX4rKCkXuxwQpSSfVET2KFsiTm8eFs93pp3h6yB3hwr";
|
|
11
|
+
export var FundTransferHookAccount;
|
|
12
|
+
(function (FundTransferHookAccount) {
|
|
13
|
+
FundTransferHookAccount[FundTransferHookAccount["FundRequestIntentId"] = 0] = "FundRequestIntentId";
|
|
14
|
+
FundTransferHookAccount[FundTransferHookAccount["HookMetadata"] = 1] = "HookMetadata";
|
|
15
|
+
FundTransferHookAccount[FundTransferHookAccount["HookState"] = 2] = "HookState";
|
|
16
|
+
FundTransferHookAccount[FundTransferHookAccount["Intent"] = 3] = "Intent";
|
|
17
|
+
FundTransferHookAccount[FundTransferHookAccount["ProviderEscrowIntentId"] = 4] = "ProviderEscrowIntentId";
|
|
18
|
+
})(FundTransferHookAccount || (FundTransferHookAccount = {}));
|
|
19
|
+
export function identifyFundTransferHookAccount(account) {
|
|
20
|
+
const data = "data" in account ? account.data : account;
|
|
21
|
+
if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([115, 10, 133, 59, 77, 84, 106, 104])), 0)) {
|
|
22
|
+
return FundTransferHookAccount.FundRequestIntentId;
|
|
23
|
+
}
|
|
24
|
+
if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([119, 227, 48, 236, 101, 194, 218, 85])), 0)) {
|
|
25
|
+
return FundTransferHookAccount.HookMetadata;
|
|
26
|
+
}
|
|
27
|
+
if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([10, 13, 71, 116, 92, 105, 237, 231])), 0)) {
|
|
28
|
+
return FundTransferHookAccount.HookState;
|
|
29
|
+
}
|
|
30
|
+
if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([247, 162, 35, 165, 254, 111, 129, 109])), 0)) {
|
|
31
|
+
return FundTransferHookAccount.Intent;
|
|
32
|
+
}
|
|
33
|
+
if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([132, 9, 212, 245, 34, 170, 187, 104])), 0)) {
|
|
34
|
+
return FundTransferHookAccount.ProviderEscrowIntentId;
|
|
35
|
+
}
|
|
36
|
+
throw new Error("The provided account could not be identified as a fundTransferHook account.");
|
|
37
|
+
}
|
|
38
|
+
export var FundTransferHookInstruction;
|
|
39
|
+
(function (FundTransferHookInstruction) {
|
|
40
|
+
FundTransferHookInstruction[FundTransferHookInstruction["AcceptAuthority"] = 0] = "AcceptAuthority";
|
|
41
|
+
FundTransferHookInstruction[FundTransferHookInstruction["AfterAction"] = 1] = "AfterAction";
|
|
42
|
+
FundTransferHookInstruction[FundTransferHookInstruction["BeforeAction"] = 2] = "BeforeAction";
|
|
43
|
+
FundTransferHookInstruction[FundTransferHookInstruction["ClaimEscrowRefund"] = 3] = "ClaimEscrowRefund";
|
|
44
|
+
FundTransferHookInstruction[FundTransferHookInstruction["CloseIntent"] = 4] = "CloseIntent";
|
|
45
|
+
FundTransferHookInstruction[FundTransferHookInstruction["Initialize"] = 5] = "Initialize";
|
|
46
|
+
FundTransferHookInstruction[FundTransferHookInstruction["NominateAuthority"] = 6] = "NominateAuthority";
|
|
47
|
+
})(FundTransferHookInstruction || (FundTransferHookInstruction = {}));
|
|
48
|
+
export function identifyFundTransferHookInstruction(instruction) {
|
|
49
|
+
const data = "data" in instruction ? instruction.data : instruction;
|
|
50
|
+
if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([107, 86, 198, 91, 33, 12, 107, 160])), 0)) {
|
|
51
|
+
return FundTransferHookInstruction.AcceptAuthority;
|
|
52
|
+
}
|
|
53
|
+
if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([100, 247, 61, 195, 161, 140, 250, 73])), 0)) {
|
|
54
|
+
return FundTransferHookInstruction.AfterAction;
|
|
55
|
+
}
|
|
56
|
+
if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([5, 61, 71, 243, 197, 108, 160, 137])), 0)) {
|
|
57
|
+
return FundTransferHookInstruction.BeforeAction;
|
|
58
|
+
}
|
|
59
|
+
if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([180, 244, 255, 206, 147, 149, 56, 223])), 0)) {
|
|
60
|
+
return FundTransferHookInstruction.ClaimEscrowRefund;
|
|
61
|
+
}
|
|
62
|
+
if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([112, 245, 154, 249, 57, 126, 54, 122])), 0)) {
|
|
63
|
+
return FundTransferHookInstruction.CloseIntent;
|
|
64
|
+
}
|
|
65
|
+
if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([175, 175, 109, 31, 13, 152, 155, 237])), 0)) {
|
|
66
|
+
return FundTransferHookInstruction.Initialize;
|
|
67
|
+
}
|
|
68
|
+
if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([148, 182, 144, 91, 186, 12, 118, 18])), 0)) {
|
|
69
|
+
return FundTransferHookInstruction.NominateAuthority;
|
|
70
|
+
}
|
|
71
|
+
throw new Error("The provided instruction could not be identified as a fundTransferHook instruction.");
|
|
72
|
+
}
|
|
73
|
+
export function parseFundTransferHookInstruction(instruction) {
|
|
74
|
+
const instructionType = identifyFundTransferHookInstruction(instruction);
|
|
75
|
+
switch (instructionType) {
|
|
76
|
+
case FundTransferHookInstruction.AcceptAuthority: {
|
|
77
|
+
assertIsInstructionWithAccounts(instruction);
|
|
78
|
+
return {
|
|
79
|
+
instructionType: FundTransferHookInstruction.AcceptAuthority,
|
|
80
|
+
...parseAcceptAuthorityInstruction(instruction),
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
case FundTransferHookInstruction.AfterAction: {
|
|
84
|
+
assertIsInstructionWithAccounts(instruction);
|
|
85
|
+
return {
|
|
86
|
+
instructionType: FundTransferHookInstruction.AfterAction,
|
|
87
|
+
...parseAfterActionInstruction(instruction),
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
case FundTransferHookInstruction.BeforeAction: {
|
|
91
|
+
assertIsInstructionWithAccounts(instruction);
|
|
92
|
+
return {
|
|
93
|
+
instructionType: FundTransferHookInstruction.BeforeAction,
|
|
94
|
+
...parseBeforeActionInstruction(instruction),
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
case FundTransferHookInstruction.ClaimEscrowRefund: {
|
|
98
|
+
assertIsInstructionWithAccounts(instruction);
|
|
99
|
+
return {
|
|
100
|
+
instructionType: FundTransferHookInstruction.ClaimEscrowRefund,
|
|
101
|
+
...parseClaimEscrowRefundInstruction(instruction),
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
case FundTransferHookInstruction.CloseIntent: {
|
|
105
|
+
assertIsInstructionWithAccounts(instruction);
|
|
106
|
+
return {
|
|
107
|
+
instructionType: FundTransferHookInstruction.CloseIntent,
|
|
108
|
+
...parseCloseIntentInstruction(instruction),
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
case FundTransferHookInstruction.Initialize: {
|
|
112
|
+
assertIsInstructionWithAccounts(instruction);
|
|
113
|
+
return {
|
|
114
|
+
instructionType: FundTransferHookInstruction.Initialize,
|
|
115
|
+
...parseInitializeInstruction(instruction),
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
case FundTransferHookInstruction.NominateAuthority: {
|
|
119
|
+
assertIsInstructionWithAccounts(instruction);
|
|
120
|
+
return {
|
|
121
|
+
instructionType: FundTransferHookInstruction.NominateAuthority,
|
|
122
|
+
...parseNominateAuthorityInstruction(instruction),
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
default:
|
|
126
|
+
throw new Error(`Unrecognized instruction type: ${instructionType}`);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
//# sourceMappingURL=fundTransferHook.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fundTransferHook.js","sourceRoot":"","sources":["../../../../../../src/core/solana/generated/fund-transfer-hook/programs/fundTransferHook.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,+BAA+B,EAC/B,aAAa,EACb,cAAc,EACd,eAAe,GAKhB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,+BAA+B,EAC/B,2BAA2B,EAC3B,4BAA4B,EAC5B,iCAAiC,EACjC,2BAA2B,EAC3B,0BAA0B,EAC1B,iCAAiC,GAQlC,MAAM,0BAA0B,CAAC;AAElC,MAAM,CAAC,MAAM,kCAAkC,GAC7C,8CAAyG,CAAC;AAE5G,MAAM,CAAN,IAAY,uBAMX;AAND,WAAY,u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ERATED using the Codama library.
|
|
3
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
4
|
+
* to add features, then rerun Codama to update it.
|
|
5
|
+
*
|
|
6
|
+
* @see https://github.com/codama-idl/codama
|
|
7
|
+
*/
|
|
8
|
+
export * from "./fundTransferHook.js";
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/core/solana/generated/fund-transfer-hook/programs/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,cAAc,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was AUTOGENERATED using the Codama library.
|
|
3
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
4
|
+
* to add features, then rerun Codama to update it.
|
|
5
|
+
*
|
|
6
|
+
* @see https://github.com/codama-idl/codama
|
|
7
|
+
*/
|
|
8
|
+
export * from "./fundTransferHook.js";
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/core/solana/generated/fund-transfer-hook/programs/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,cAAc,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was AUTOGENERATED using the Codama library.
|
|
3
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
4
|
+
* to add features, then rerun Codama to update it.
|
|
5
|
+
*
|
|
6
|
+
* @see https://github.com/codama-idl/codama
|
|
7
|
+
*/
|
|
8
|
+
import { type AccountMeta, type AccountSignerMeta, type Address, type ProgramDerivedAddress, type TransactionSigner } from "@solana/kit";
|
|
9
|
+
/**
|
|
10
|
+
* Asserts that the given value is not null or undefined.
|
|
11
|
+
* @internal
|
|
12
|
+
*/
|
|
13
|
+
export declare function expectSome<T>(value: T | null | undefined): T;
|
|
14
|
+
/**
|
|
15
|
+
* Asserts that the given value is a PublicKey.
|
|
16
|
+
* @internal
|
|
17
|
+
*/
|
|
18
|
+
export declare function expectAddress<T extends string = string>(value: Address<T> | ProgramDerivedAddress<T> | TransactionSigner<T> | null | undefined): Address<T>;
|
|
19
|
+
/**
|
|
20
|
+
* Asserts that the given value is a PDA.
|
|
21
|
+
* @internal
|
|
22
|
+
*/
|
|
23
|
+
export declare function expectProgramDerivedAddress<T extends string = string>(value: Address<T> | ProgramDerivedAddress<T> | TransactionSigner<T> | null | undefined): ProgramDerivedAddress<T>;
|
|
24
|
+
/**
|
|
25
|
+
* Asserts that the given value is a TransactionSigner.
|
|
26
|
+
* @internal
|
|
27
|
+
*/
|
|
28
|
+
export declare function expectTransactionSigner<T extends string = string>(value: Address<T> | ProgramDerivedAddress<T> | TransactionSigner<T> | null | undefined): TransactionSigner<T>;
|
|
29
|
+
/**
|
|
30
|
+
* Defines an instruction account to resolve.
|
|
31
|
+
* @internal
|
|
32
|
+
*/
|
|
33
|
+
export type ResolvedAccount<T extends string = string, U extends Address<T> | ProgramDerivedAddress<T> | TransactionSigner<T> | null = Address<T> | ProgramDerivedAddress<T> | TransactionSigner<T> | null> = {
|
|
34
|
+
isWritable: boolean;
|
|
35
|
+
value: U;
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* Defines an instruction that stores additional bytes on-chain.
|
|
39
|
+
* @internal
|
|
40
|
+
*/
|
|
41
|
+
export type InstructionWithByteDelta = {
|
|
42
|
+
byteDelta: number;
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* Get account metas and signers from resolved accounts.
|
|
46
|
+
* @internal
|
|
47
|
+
*/
|
|
48
|
+
export declare function getAccountMetaFactory(programAddress: Address, optionalAccountStrategy: "omitted" | "programId"): (account: ResolvedAccount) => AccountMeta | AccountSignerMeta | undefined;
|
|
49
|
+
export declare function isTransactionSigner<TAddress extends string = string>(value: Address<TAddress> | ProgramDerivedAddress<TAddress> | TransactionSigner<TAddress>): value is TransactionSigner<TAddress>;
|
|
50
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/core/solana/generated/fund-transfer-hook/shared/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAIL,KAAK,WAAW,EAChB,KAAK,iBAAiB,EACtB,KAAK,OAAO,EACZ,KAAK,qBAAqB,EAC1B,KAAK,iBAAiB,EAEvB,MAAM,aAAa,CAAC;AAErB;;;GAGG;AACH,wBAAgB,UAAU,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,IAAI,GAAG,SAAS,GAAG,CAAC,CAK5D;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,EACrD,KAAK,EACD,OAAO,CAAC,CAAC,CAAC,GACV,qBAAqB,CAAC,CAAC,CAAC,GACxB,iBAAiB,CAAC,CAAC,CAAC,GACpB,IAAI,GACJ,SAAS,GACZ,OAAO,CAAC,CAAC,CAAC,CAWZ;AAED;;;GAGG;AACH,wBAAgB,2BAA2B,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,EACnE,KAAK,EACD,OAAO,CAAC,CAAC,CAAC,GACV,qBAAqB,CAAC,CAAC,CAAC,GACxB,iBAAiB,CAAC,CAAC,CAAC,GACpB,IAAI,GACJ,SAAS,GACZ,qBAAqB,CAAC,CAAC,CAAC,CAK1B;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,EAC/D,KAAK,EACD,OAAO,CAAC,CAAC,CAAC,GACV,qBAAqB,CAAC,CAAC,CAAC,GACxB,iBAAiB,CAAC,CAAC,CAAC,GACpB,IAAI,GACJ,SAAS,GACZ,iBAAiB,CAAC,CAAC,CAAC,CAKtB;AAED;;;GAGG;AACH,MAAM,MAAM,eAAe,CACzB,CAAC,SAAS,MAAM,GAAG,MAAM,EACzB,CAAC,SACG,OAAO,CAAC,CAAC,CAAC,GACV,qBAAqB,CAAC,CAAC,CAAC,GACxB,iBAAiB,CAAC,CAAC,CAAC,GACpB,IAAI,GACJ,OAAO,CAAC,CAAC,CAAC,GACV,qBAAqB,CAAC,CAAC,CAAC,GACxB,iBAAiB,CAAC,CAAC,CAAC,GACpB,IAAI,IACN;IACF,UAAU,EAAE,OAAO,CAAC;IACpB,KAAK,EAAE,CAAC,CAAC;CACV,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,wBAAwB,GAAG;IACrC,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF;;;GAGG;AACH,wBAAgB,qBAAqB,CACnC,cAAc,EAAE,OAAO,EACvB,uBAAuB,EAAE,SAAS,GAAG,WAAW,IAG9C,SAAS,eAAe,KACvB,WAAW,GAAG,iBAAiB,GAAG,SAAS,CAoB/C;AAED,wBAAgB,mBAAmB,CAAC,QAAQ,SAAS,MAAM,GAAG,MAAM,EAClE,KAAK,EACD,OAAO,CAAC,QAAQ,CAAC,GACjB,qBAAqB,CAAC,QAAQ,CAAC,GAC/B,iBAAiB,CAAC,QAAQ,CAAC,GAC9B,KAAK,IAAI,iBAAiB,CAAC,QAAQ,CAAC,CAOtC"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was AUTOGENERATED using the Codama library.
|
|
3
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
4
|
+
* to add features, then rerun Codama to update it.
|
|
5
|
+
*
|
|
6
|
+
* @see https://github.com/codama-idl/codama
|
|
7
|
+
*/
|
|
8
|
+
import { AccountRole, isProgramDerivedAddress, isTransactionSigner as kitIsTransactionSigner, upgradeRoleToSigner, } from "@solana/kit";
|
|
9
|
+
/**
|
|
10
|
+
* Asserts that the given value is not null or undefined.
|
|
11
|
+
* @internal
|
|
12
|
+
*/
|
|
13
|
+
export function expectSome(value) {
|
|
14
|
+
if (value === null || value === undefined) {
|
|
15
|
+
throw new Error("Expected a value but received null or undefined.");
|
|
16
|
+
}
|
|
17
|
+
return value;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Asserts that the given value is a PublicKey.
|
|
21
|
+
* @internal
|
|
22
|
+
*/
|
|
23
|
+
export function expectAddress(value) {
|
|
24
|
+
if (!value) {
|
|
25
|
+
throw new Error("Expected a Address.");
|
|
26
|
+
}
|
|
27
|
+
if (typeof value === "object" && "address" in value) {
|
|
28
|
+
return value.address;
|
|
29
|
+
}
|
|
30
|
+
if (Array.isArray(value)) {
|
|
31
|
+
return value[0];
|
|
32
|
+
}
|
|
33
|
+
return value;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Asserts that the given value is a PDA.
|
|
37
|
+
* @internal
|
|
38
|
+
*/
|
|
39
|
+
export function expectProgramDerivedAddress(value) {
|
|
40
|
+
if (!value || !Array.isArray(value) || !isProgramDerivedAddress(value)) {
|
|
41
|
+
throw new Error("Expected a ProgramDerivedAddress.");
|
|
42
|
+
}
|
|
43
|
+
return value;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Asserts that the given value is a TransactionSigner.
|
|
47
|
+
* @internal
|
|
48
|
+
*/
|
|
49
|
+
export function expectTransactionSigner(value) {
|
|
50
|
+
if (!value || !isTransactionSigner(value)) {
|
|
51
|
+
throw new Error("Expected a TransactionSigner.");
|
|
52
|
+
}
|
|
53
|
+
return value;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Get account metas and signers from resolved accounts.
|
|
57
|
+
* @internal
|
|
58
|
+
*/
|
|
59
|
+
export function getAccountMetaFactory(programAddress, optionalAccountStrategy) {
|
|
60
|
+
return (account) => {
|
|
61
|
+
if (!account.value) {
|
|
62
|
+
if (optionalAccountStrategy === "omitted")
|
|
63
|
+
return;
|
|
64
|
+
return Object.freeze({
|
|
65
|
+
address: programAddress,
|
|
66
|
+
role: AccountRole.READONLY,
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
const writableRole = account.isWritable
|
|
70
|
+
? AccountRole.WRITABLE
|
|
71
|
+
: AccountRole.READONLY;
|
|
72
|
+
return Object.freeze({
|
|
73
|
+
address: expectAddress(account.value),
|
|
74
|
+
role: isTransactionSigner(account.value)
|
|
75
|
+
? upgradeRoleToSigner(writableRole)
|
|
76
|
+
: writableRole,
|
|
77
|
+
...(isTransactionSigner(account.value) ? { signer: account.value } : {}),
|
|
78
|
+
});
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
export function isTransactionSigner(value) {
|
|
82
|
+
return (!!value &&
|
|
83
|
+
typeof value === "object" &&
|
|
84
|
+
"address" in value &&
|
|
85
|
+
kitIsTransactionSigner(value));
|
|
86
|
+
}
|
|
87
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/core/solana/generated/fund-transfer-hook/shared/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,WAAW,EACX,uBAAuB,EACvB,mBAAmB,IAAI,sBAAsB,EAM7C,mBAAmB,GACpB,MAAM,aAAa,CAAC;AAErB;;;GAGG;AACH,MAAM,UAAU,UAAU,CAAI,KAA2B;IACvD,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QAC1C,MAAM,IAAI,KAAK,CAAC,kDAAkD,CAAC,CAAC;IACtE,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,aAAa,CAC3B,KAKa;IAEb,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,MAAM,IAAI,KAAK,CAAC,qBAAqB,CAAC,CAAC;IACzC,CAAC;IACD,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,SAAS,IAAI,KAAK,EAAE,CAAC;QACpD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C,IAAI,EAAE,mBAAmB,CAAC,OAAO,CAAC,KAAK,CAAC;gBACtC,CAAC,CAAC,mBAAmB,CAAC,YAAY,CAAC;gBACnC,CAAC,CAAC,YAAY;YAChB,GAAG,CAAC,mBAAmB,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SACzE,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,mBAAmB,CACjC,KAG+B;IAE/B,OAAO,CACL,CAAC,CAAC,KAAK;QACP,OAAO,KAAK,KAAK,QAAQ;QACzB,SAAS,IAAI,KAAK;QAClB,sBAAsB,CAAC,KAAK,CAAC,CAC9B,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* General Solana wallet helpers — balances + transfer instruction builders.
|
|
3
|
+
*
|
|
4
|
+
* These are EVM-consistent: like the EVM provider keeps a generic
|
|
5
|
+
* `sendTransaction(call)` and relies on encoders to build the call, the Solana
|
|
6
|
+
* provider keeps a generic `sendInstructions(instructions)` and these pure
|
|
7
|
+
* helpers build the instructions / read balances. Compose them and pass to
|
|
8
|
+
* `adapter.sendInstructions(...)`; read balances with `adapter.getRpc()`.
|
|
9
|
+
*
|
|
10
|
+
* Amounts are raw base units: lamports for SOL, token base units for SPL.
|
|
11
|
+
*/
|
|
12
|
+
import { type Address, type Rpc, type SolanaRpcApi } from "@solana/kit";
|
|
13
|
+
import type { SolanaInstructionLike } from "../../providers/types.js";
|
|
14
|
+
export declare const SYSTEM_PROGRAM_ID: Address;
|
|
15
|
+
export declare const TOKEN_PROGRAM_ID: Address;
|
|
16
|
+
export declare const ATA_PROGRAM_ID: Address;
|
|
17
|
+
/** Derive the Associated Token Account address for (owner, mint). */
|
|
18
|
+
export declare function deriveAta(owner: Address, mint: Address): Promise<Address>;
|
|
19
|
+
/**
|
|
20
|
+
* Build an idempotent "create ATA" instruction (succeeds even if the ATA
|
|
21
|
+
* already exists). `payer` funds the rent.
|
|
22
|
+
*/
|
|
23
|
+
export declare function buildCreateAtaIdempotentIx(payer: Address, ata: Address, owner: Address, mint: Address): SolanaInstructionLike;
|
|
24
|
+
/** Build a System-program SOL transfer instruction. `lamports` is base units. */
|
|
25
|
+
export declare function buildSolTransferIx(from: Address, to: Address, lamports: bigint): SolanaInstructionLike;
|
|
26
|
+
/**
|
|
27
|
+
* Build the instructions to send an SPL token from `owner` to `recipient`:
|
|
28
|
+
* an idempotent create of the recipient's ATA (no EVM analog — a token account
|
|
29
|
+
* must exist before it can receive) followed by the SPL Token transfer.
|
|
30
|
+
* `amount` is token base units. `payer` funds the recipient-ATA rent.
|
|
31
|
+
*/
|
|
32
|
+
export declare function buildSplTransferInstructions(params: {
|
|
33
|
+
owner: Address;
|
|
34
|
+
recipient: Address;
|
|
35
|
+
mint: Address;
|
|
36
|
+
amount: bigint;
|
|
37
|
+
payer: Address;
|
|
38
|
+
}): Promise<SolanaInstructionLike[]>;
|
|
39
|
+
/** Native SOL balance in lamports. */
|
|
40
|
+
export declare function getSolBalance(rpc: Rpc<SolanaRpcApi>, address: Address): Promise<bigint>;
|
|
41
|
+
/**
|
|
42
|
+
* SPL token balance for (owner, mint). Returns raw base units + decimals.
|
|
43
|
+
* A missing token account is reported as zero (decimals resolved from the mint).
|
|
44
|
+
*/
|
|
45
|
+
export declare function getSplTokenBalance(rpc: Rpc<SolanaRpcApi>, owner: Address, mint: Address): Promise<{
|
|
46
|
+
amount: bigint;
|
|
47
|
+
decimals: number;
|
|
48
|
+
}>;
|
|
49
|
+
//# sourceMappingURL=wallet.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wallet.d.ts","sourceRoot":"","sources":["../../../src/core/solana/wallet.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,G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CAAE,CAAC,CAa/C"}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* General Solana wallet helpers — balances + transfer instruction builders.
|
|
3
|
+
*
|
|
4
|
+
* These are EVM-consistent: like the EVM provider keeps a generic
|
|
5
|
+
* `sendTransaction(call)` and relies on encoders to build the call, the Solana
|
|
6
|
+
* provider keeps a generic `sendInstructions(instructions)` and these pure
|
|
7
|
+
* helpers build the instructions / read balances. Compose them and pass to
|
|
8
|
+
* `adapter.sendInstructions(...)`; read balances with `adapter.getRpc()`.
|
|
9
|
+
*
|
|
10
|
+
* Amounts are raw base units: lamports for SOL, token base units for SPL.
|
|
11
|
+
*/
|
|
12
|
+
import { AccountRole, getProgramDerivedAddress, getAddressEncoder, } from "@solana/kit";
|
|
13
|
+
// ---------------------------------------------------------------------------
|
|
14
|
+
// Program ids
|
|
15
|
+
// ---------------------------------------------------------------------------
|
|
16
|
+
export const SYSTEM_PROGRAM_ID = "11111111111111111111111111111111";
|
|
17
|
+
export const TOKEN_PROGRAM_ID = "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
|
|
18
|
+
export const ATA_PROGRAM_ID = "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL";
|
|
19
|
+
// ---------------------------------------------------------------------------
|
|
20
|
+
// Associated Token Account helpers
|
|
21
|
+
// ---------------------------------------------------------------------------
|
|
22
|
+
/** Derive the Associated Token Account address for (owner, mint). */
|
|
23
|
+
export async function deriveAta(owner, mint) {
|
|
24
|
+
const enc = getAddressEncoder();
|
|
25
|
+
const [pda] = await getProgramDerivedAddress({
|
|
26
|
+
programAddress: ATA_PROGRAM_ID,
|
|
27
|
+
seeds: [enc.encode(owner), enc.encode(TOKEN_PROGRAM_ID), enc.encode(mint)],
|
|
28
|
+
});
|
|
29
|
+
return pda;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Build an idempotent "create ATA" instruction (succeeds even if the ATA
|
|
33
|
+
* already exists). `payer` funds the rent.
|
|
34
|
+
*/
|
|
35
|
+
export function buildCreateAtaIdempotentIx(payer, ata, owner, mint) {
|
|
36
|
+
return {
|
|
37
|
+
programAddress: ATA_PROGRAM_ID,
|
|
38
|
+
accounts: [
|
|
39
|
+
{ address: payer, role: AccountRole.WRITABLE_SIGNER },
|
|
40
|
+
{ address: ata, role: AccountRole.WRITABLE },
|
|
41
|
+
{ address: owner, role: AccountRole.READONLY },
|
|
42
|
+
{ address: mint, role: AccountRole.READONLY },
|
|
43
|
+
{ address: SYSTEM_PROGRAM_ID, role: AccountRole.READONLY },
|
|
44
|
+
{ address: TOKEN_PROGRAM_ID, role: AccountRole.READONLY },
|
|
45
|
+
],
|
|
46
|
+
data: new Uint8Array([1]), // CreateIdempotent
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
// ---------------------------------------------------------------------------
|
|
50
|
+
// Transfer instruction builders
|
|
51
|
+
// ---------------------------------------------------------------------------
|
|
52
|
+
/** Build a System-program SOL transfer instruction. `lamports` is base units. */
|
|
53
|
+
export function buildSolTransferIx(from, to, lamports) {
|
|
54
|
+
const data = new Uint8Array(12);
|
|
55
|
+
const view = new DataView(data.buffer);
|
|
56
|
+
view.setUint32(0, 2, true); // System Transfer instruction index
|
|
57
|
+
view.setBigUint64(4, lamports, true);
|
|
58
|
+
return {
|
|
59
|
+
programAddress: SYSTEM_PROGRAM_ID,
|
|
60
|
+
accounts: [
|
|
61
|
+
{ address: from, role: AccountRole.WRITABLE_SIGNER },
|
|
62
|
+
{ address: to, role: AccountRole.WRITABLE },
|
|
63
|
+
],
|
|
64
|
+
data,
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Build the instructions to send an SPL token from `owner` to `recipient`:
|
|
69
|
+
* an idempotent create of the recipient's ATA (no EVM analog — a token account
|
|
70
|
+
* must exist before it can receive) followed by the SPL Token transfer.
|
|
71
|
+
* `amount` is token base units. `payer` funds the recipient-ATA rent.
|
|
72
|
+
*/
|
|
73
|
+
export async function buildSplTransferInstructions(params) {
|
|
74
|
+
const { owner, recipient, mint, amount, payer } = params;
|
|
75
|
+
const source = await deriveAta(owner, mint);
|
|
76
|
+
const dest = await deriveAta(recipient, mint);
|
|
77
|
+
const data = new Uint8Array(9);
|
|
78
|
+
data[0] = 3; // SPL Token Transfer instruction index
|
|
79
|
+
new DataView(data.buffer).setBigUint64(1, amount, true);
|
|
80
|
+
const transferIx = {
|
|
81
|
+
programAddress: TOKEN_PROGRAM_ID,
|
|
82
|
+
accounts: [
|
|
83
|
+
{ address: source, role: AccountRole.WRITABLE },
|
|
84
|
+
{ address: dest, role: AccountRole.WRITABLE },
|
|
85
|
+
{ address: owner, role: AccountRole.READONLY_SIGNER },
|
|
86
|
+
],
|
|
87
|
+
data,
|
|
88
|
+
};
|
|
89
|
+
return [buildCreateAtaIdempotentIx(payer, dest, recipient, mint), transferIx];
|
|
90
|
+
}
|
|
91
|
+
// ---------------------------------------------------------------------------
|
|
92
|
+
// Balance reads
|
|
93
|
+
// ---------------------------------------------------------------------------
|
|
94
|
+
/** Native SOL balance in lamports. */
|
|
95
|
+
export async function getSolBalance(rpc, address) {
|
|
96
|
+
const { value } = await rpc.getBalance(address).send();
|
|
97
|
+
return BigInt(value);
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* SPL token balance for (owner, mint). Returns raw base units + decimals.
|
|
101
|
+
* A missing token account is reported as zero (decimals resolved from the mint).
|
|
102
|
+
*/
|
|
103
|
+
export async function getSplTokenBalance(rpc, owner, mint) {
|
|
104
|
+
const ata = await deriveAta(owner, mint);
|
|
105
|
+
try {
|
|
106
|
+
const { value } = await rpc.getTokenAccountBalance(ata).send();
|
|
107
|
+
return { amount: BigInt(value.amount), decimals: value.decimals };
|
|
108
|
+
}
|
|
109
|
+
catch {
|
|
110
|
+
try {
|
|
111
|
+
const { value } = await rpc.getTokenSupply(mint).send();
|
|
112
|
+
return { amount: 0n, decimals: value.decimals };
|
|
113
|
+
}
|
|
114
|
+
catch {
|
|
115
|
+
return { amount: 0n, decimals: 0 };
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
//# sourceMappingURL=wallet.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wallet.js","sourceRoot":"","sources":["../../../src/core/solana/wallet.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAIL,WAAW,EACX,wBAAwB,EACxB,iBAAiB,GAClB,MAAM,aAAa,CAAC;AAGrB,8EAA8E;AAC9E,cAAc;AACd,8EAA8E;AAE9E,MAAM,CAAC,MAAM,iBAAiB,GAC5B,kCAA6C,CAAC;AAChD,MAAM,CAAC,MAAM,gBAAgB,GAC3B,6CAAwD,CAAC;AAC3D,MAAM,CAAC,MAAM,cAAc,GACzB,8CAAyD,CAAC;AAE5D,8EAA8E;AAC9E,mCAAmC;AACnC,8EAA8E;AAE9E,qEAAqE;AACrE,MAAM,CAAC,KAAK,UAAU,SAAS,CAC7B,KAAc,EACd,IAAa;IAEb,MAAM,GAAG,GAAG,iBAAiB,EAAE,CAAC;IAChC,MAAM,CAAC,GAAG,CAAC,GAAG,MAAM,wBAAwB,CAAC;QAC3C,cAAc,EAAE,cAAc;QAC9B,KAAK,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,gBAAgB,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;KAC3E,CAAC,CAAC;IACH,OAAO,GAAG,CAAC;AACb,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,0BAA0B,CACxC,KAAc,EACd,GAAY,EACZ,KAAc,EACd,IAAa;IAEb,OAAO;QACL,cAAc,EAAE,cAAc;QAC9B,QAAQ,EAAE;YACR,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,WAAW,CAAC,eAAe,EAAE;YACrD,EAAE,OAAO,EA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Eb,MAAM,GAAG,GAAG,MAAM,SAAS,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;IACzC,IAAI,CAAC;QACH,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,GAAG,CAAC,sBAAsB,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC;QAC/D,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,KAAK,CAAC,QAAQ,EAAE,CAAC;IACpE,CAAC;IAAC,MAAM,CAAC;QACP,IAAI,CAAC;YACH,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,GAAG,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,CAAC;YACxD,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE,QAAQ,EAAE,KAAK,CAAC,QAAQ,EAAE,CAAC;QAClD,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE,QAAQ,EAAE,CAAC,EAAE,CAAC;QACrC,CAAC;IACH,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { AcpChatTransport, JobRoomEntry } from "./types";
|
|
2
|
+
import { AcpHttpClient, type AcpHttpClientOptions } from "./acpHttpClient";
|
|
3
|
+
export type SocketTransportOptions = AcpHttpClientOptions;
|
|
4
|
+
export declare class SocketTransport extends AcpHttpClient implements AcpChatTransport {
|
|
5
|
+
private socket;
|
|
6
|
+
private heartbeatInterval;
|
|
7
|
+
private entryHandler;
|
|
8
|
+
private lastEventTimestamp;
|
|
9
|
+
private seenEntries;
|
|
10
|
+
constructor(opts?: SocketTransportOptions);
|
|
11
|
+
connect(onConnected?: () => void): Promise<void>;
|
|
12
|
+
disconnect(): Promise<void>;
|
|
13
|
+
onEntry(handler: (entry: JobRoomEntry) => void): void;
|
|
14
|
+
sendMessage(chainId: number, jobId: string, content: string, contentType?: string): void;
|
|
15
|
+
postMessage(chainId: number, jobId: string, content: string, contentType?: string): Promise<void>;
|
|
16
|
+
getHistory(chainId: number, jobId: string): Promise<JobRoomEntry[]>;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=socketTransport.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"socketTransport.d.ts","sourceRoot":"","sources":["../../src/events/socketTransport.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,YAAY,EAAoB,MAAM,SAAS,CAAC;AAChF,OAAO,EAAE,aAAa,EAAE,KAAK,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAE3E,MAAM,MAAM,sBAAsB,GAAG,oBAAoB,CAAC;AAE1D,qBAAa,eAAgB,SAAQ,aAAc,YAAW,gBAAgB;IAC5E,OAAO,CAAC,MAAM,CAAuB;IACrC,OAAO,CAAC,iBAAiB,CAA+C;IACxE,OAAO,CAAC,YAAY,CAAgD;IACpE,OAAO,CAAC,kBAAkB,CAAuB;IACjD,OAAO,CAAC,WAAW,CAAqB;gBAE5B,IAAI,GAAE,sBAA2B;IAQvC,OAAO,CAAC,WAAW,CAAC,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;IAyDhD,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAmBjC,OAAO,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE,YAAY,KAAK,IAAI,GAAG,IAAI;IAQrD,WAAW,CACT,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,MAAM,EACf,WAAW,GAAE,MAAe,GAC3B,IAAI;IAcD,WAAW,CACf,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,MAAM,EACf,WAAW,GAAE,MAAe,GAC3B,OAAO,CAAC,IAAI,CAAC;IAoBV,UAAU,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC;CAQ1E"}
|