@oobe-protocol-labs/synapse-sap-sdk 0.13.0 → 0.15.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.
- package/dist/cjs/accounts/index.js +286 -0
- package/dist/cjs/accounts/index.js.map +1 -0
- package/dist/cjs/client.js +125 -0
- package/dist/cjs/client.js.map +1 -0
- package/dist/cjs/constants/seeds.js +9 -9
- package/dist/cjs/constants/seeds.js.map +1 -1
- package/dist/cjs/constants.js +66 -0
- package/dist/cjs/constants.js.map +1 -0
- package/dist/cjs/errors.js +260 -0
- package/dist/cjs/errors.js.map +1 -0
- package/dist/cjs/events/index.js +37 -123
- package/dist/cjs/events/index.js.map +1 -1
- package/dist/cjs/idlTypes.js +4 -0
- package/dist/cjs/idlTypes.js.map +1 -0
- package/dist/cjs/index.js +75 -241
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/instructions/agent.js +90 -0
- package/dist/cjs/instructions/agent.js.map +1 -0
- package/dist/cjs/instructions/attestation.js +113 -0
- package/dist/cjs/instructions/attestation.js.map +1 -0
- package/dist/cjs/instructions/digest.js +29 -0
- package/dist/cjs/instructions/digest.js.map +1 -0
- package/dist/cjs/instructions/dispute.js +117 -0
- package/dist/cjs/instructions/dispute.js.map +1 -0
- package/dist/cjs/instructions/escrow.js +102 -0
- package/dist/cjs/instructions/escrow.js.map +1 -0
- package/dist/cjs/instructions/global.js +29 -0
- package/dist/cjs/instructions/global.js.map +1 -0
- package/dist/cjs/instructions/index.js +31 -0
- package/dist/cjs/instructions/index.js.map +1 -0
- package/dist/cjs/instructions/indexing.js +222 -0
- package/dist/cjs/instructions/indexing.js.map +1 -0
- package/dist/cjs/instructions/misc.js +74 -0
- package/dist/cjs/instructions/misc.js.map +1 -0
- package/dist/cjs/instructions/session.js +90 -0
- package/dist/cjs/instructions/session.js.map +1 -0
- package/dist/cjs/instructions/staking.js +133 -0
- package/dist/cjs/instructions/staking.js.map +1 -0
- package/dist/cjs/instructions/subscription.js +81 -0
- package/dist/cjs/instructions/subscription.js.map +1 -0
- package/dist/cjs/instructions/tools.js +110 -0
- package/dist/cjs/instructions/tools.js.map +1 -0
- package/dist/cjs/instructions/vault.js +107 -0
- package/dist/cjs/instructions/vault.js.map +1 -0
- package/dist/cjs/pdas/index.js +120 -0
- package/dist/cjs/pdas/index.js.map +1 -0
- package/dist/cjs/registries/fairscale.js +1 -1
- package/dist/cjs/registries/fairscale.js.map +1 -1
- package/dist/cjs/registries/metaplex-bridge.js +1 -1
- package/dist/cjs/registries/metaplex-bridge.js.map +1 -1
- package/dist/cjs/types.js +45 -0
- package/dist/cjs/types.js.map +1 -0
- package/dist/cjs/utils/escrow-validation.js +1 -1
- package/dist/cjs/utils/escrow-validation.js.map +1 -1
- package/dist/cjs/utils/index.js +32 -83
- package/dist/cjs/utils/index.js.map +1 -1
- package/dist/cjs/utils/merchant-validator.js +5 -5
- package/dist/cjs/utils/merchant-validator.js.map +1 -1
- package/dist/cjs/utils/validate.js +236 -0
- package/dist/cjs/utils/validate.js.map +1 -0
- package/dist/cjs/utils/volume-curve.js +1 -1
- package/dist/cjs/utils/volume-curve.js.map +1 -1
- package/dist/esm/accounts/index.d.ts +11 -0
- package/dist/esm/accounts/index.d.ts.map +1 -0
- package/dist/esm/accounts/index.js +273 -0
- package/dist/esm/accounts/index.js.map +1 -0
- package/dist/esm/client.d.ts +55 -0
- package/dist/esm/client.d.ts.map +1 -0
- package/dist/esm/client.js +87 -0
- package/dist/esm/client.js.map +1 -0
- package/dist/esm/constants/addresses.d.ts +117 -0
- package/dist/esm/constants/addresses.d.ts.map +1 -0
- package/dist/esm/constants/index.d.ts +31 -0
- package/dist/esm/constants/index.d.ts.map +1 -0
- package/dist/esm/constants/limits.d.ts +149 -0
- package/dist/esm/constants/limits.d.ts.map +1 -0
- package/{src/constants/network.ts → dist/esm/constants/network.d.ts} +23 -31
- package/dist/esm/constants/network.d.ts.map +1 -0
- package/{src/constants/payments.ts → dist/esm/constants/payments.d.ts} +11 -35
- package/dist/esm/constants/payments.d.ts.map +1 -0
- package/{src/constants/programs.ts → dist/esm/constants/programs.d.ts} +6 -20
- package/dist/esm/constants/programs.d.ts.map +1 -0
- package/dist/esm/constants/seeds.d.ts +80 -0
- package/dist/esm/constants/seeds.d.ts.map +1 -0
- package/dist/esm/constants/seeds.js +9 -9
- package/dist/esm/constants/seeds.js.map +1 -1
- package/dist/esm/constants.d.ts +39 -0
- package/dist/esm/constants.d.ts.map +1 -0
- package/dist/esm/constants.js +41 -0
- package/dist/esm/constants.js.map +1 -0
- package/dist/esm/core/client.d.ts +452 -0
- package/dist/esm/core/client.d.ts.map +1 -0
- package/dist/esm/core/connection.d.ts +305 -0
- package/dist/esm/core/connection.d.ts.map +1 -0
- package/{src/core/index.ts → dist/esm/core/index.d.ts} +1 -1
- package/dist/esm/core/index.d.ts.map +1 -0
- package/dist/esm/errors/index.d.ts +276 -0
- package/dist/esm/errors/index.d.ts.map +1 -0
- package/dist/esm/errors.d.ts +119 -0
- package/dist/esm/errors.d.ts.map +1 -0
- package/dist/esm/errors.js +252 -0
- package/dist/esm/errors.js.map +1 -0
- package/dist/esm/events/geyser.d.ts +150 -0
- package/dist/esm/events/geyser.d.ts.map +1 -0
- package/dist/esm/events/index.d.ts +17 -0
- package/dist/esm/events/index.d.ts.map +1 -0
- package/dist/esm/events/index.js +34 -122
- package/dist/esm/events/index.js.map +1 -1
- package/{src/idl/index.ts → dist/esm/idl/index.d.ts} +9 -15
- package/dist/esm/idl/index.d.ts.map +1 -0
- package/dist/esm/idlTypes.d.ts +925 -0
- package/dist/esm/idlTypes.d.ts.map +1 -0
- package/dist/esm/idlTypes.js +3 -0
- package/dist/esm/idlTypes.js.map +1 -0
- package/dist/esm/index.d.ts +12 -0
- package/dist/esm/index.d.ts.map +1 -0
- package/dist/esm/index.js +15 -88
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/instructions/agent.d.ts +71 -0
- package/dist/esm/instructions/agent.d.ts.map +1 -0
- package/dist/esm/instructions/agent.js +86 -0
- package/dist/esm/instructions/agent.js.map +1 -0
- package/dist/esm/instructions/attestation.d.ts +76 -0
- package/dist/esm/instructions/attestation.d.ts.map +1 -0
- package/dist/esm/instructions/attestation.js +109 -0
- package/dist/esm/instructions/attestation.js.map +1 -0
- package/dist/esm/instructions/digest.d.ts +20 -0
- package/dist/esm/instructions/digest.d.ts.map +1 -0
- package/dist/esm/instructions/digest.js +25 -0
- package/dist/esm/instructions/digest.js.map +1 -0
- package/dist/esm/instructions/dispute.d.ts +81 -0
- package/dist/esm/instructions/dispute.d.ts.map +1 -0
- package/dist/esm/instructions/dispute.js +113 -0
- package/dist/esm/instructions/dispute.js.map +1 -0
- package/dist/esm/instructions/escrow.d.ts +79 -0
- package/dist/esm/instructions/escrow.d.ts.map +1 -0
- package/dist/esm/instructions/escrow.js +98 -0
- package/dist/esm/instructions/escrow.js.map +1 -0
- package/dist/esm/instructions/global.d.ts +14 -0
- package/dist/esm/instructions/global.d.ts.map +1 -0
- package/dist/esm/instructions/global.js +25 -0
- package/dist/esm/instructions/global.js.map +1 -0
- package/dist/esm/instructions/index.d.ts +14 -0
- package/dist/esm/instructions/index.d.ts.map +1 -0
- package/dist/esm/instructions/index.js +15 -0
- package/dist/esm/instructions/index.js.map +1 -0
- package/dist/esm/instructions/indexing.d.ts +150 -0
- package/dist/esm/instructions/indexing.d.ts.map +1 -0
- package/dist/esm/instructions/indexing.js +218 -0
- package/dist/esm/instructions/indexing.js.map +1 -0
- package/dist/esm/instructions/memory.d.ts +8 -0
- package/dist/esm/instructions/memory.d.ts.map +1 -0
- package/dist/esm/instructions/memory.js +234 -0
- package/dist/esm/instructions/memory.js.map +1 -0
- package/dist/esm/instructions/misc.d.ts +50 -0
- package/dist/esm/instructions/misc.d.ts.map +1 -0
- package/dist/esm/instructions/misc.js +70 -0
- package/dist/esm/instructions/misc.js.map +1 -0
- package/dist/esm/instructions/session.d.ts +57 -0
- package/dist/esm/instructions/session.d.ts.map +1 -0
- package/dist/esm/instructions/session.js +86 -0
- package/dist/esm/instructions/session.js.map +1 -0
- package/dist/esm/instructions/staking.d.ts +85 -0
- package/dist/esm/instructions/staking.d.ts.map +1 -0
- package/dist/esm/instructions/staking.js +129 -0
- package/dist/esm/instructions/staking.js.map +1 -0
- package/dist/esm/instructions/subscription.d.ts +50 -0
- package/dist/esm/instructions/subscription.d.ts.map +1 -0
- package/dist/esm/instructions/subscription.js +77 -0
- package/dist/esm/instructions/subscription.js.map +1 -0
- package/dist/esm/instructions/tools.d.ts +88 -0
- package/dist/esm/instructions/tools.d.ts.map +1 -0
- package/dist/esm/instructions/tools.js +106 -0
- package/dist/esm/instructions/tools.js.map +1 -0
- package/dist/esm/instructions/vault.d.ts +84 -0
- package/dist/esm/instructions/vault.d.ts.map +1 -0
- package/dist/esm/instructions/vault.js +103 -0
- package/dist/esm/instructions/vault.js.map +1 -0
- package/dist/esm/modules/agent.d.ts +166 -0
- package/dist/esm/modules/agent.d.ts.map +1 -0
- package/dist/esm/modules/attestation.d.ts +96 -0
- package/dist/esm/modules/attestation.d.ts.map +1 -0
- package/dist/esm/modules/base.d.ts +161 -0
- package/dist/esm/modules/base.d.ts.map +1 -0
- package/dist/esm/modules/escrow-v2.d.ts +169 -0
- package/dist/esm/modules/escrow-v2.d.ts.map +1 -0
- package/dist/esm/modules/feedback.d.ts +105 -0
- package/dist/esm/modules/feedback.d.ts.map +1 -0
- package/{src/modules/index.ts → dist/esm/modules/index.d.ts} +1 -1
- package/dist/esm/modules/index.d.ts.map +1 -0
- package/dist/esm/modules/indexing.d.ts +200 -0
- package/dist/esm/modules/indexing.d.ts.map +1 -0
- package/dist/esm/modules/ledger.d.ts +150 -0
- package/dist/esm/modules/ledger.d.ts.map +1 -0
- package/dist/esm/modules/receipt.d.ts +77 -0
- package/dist/esm/modules/receipt.d.ts.map +1 -0
- package/dist/esm/modules/staking.d.ts +51 -0
- package/dist/esm/modules/staking.d.ts.map +1 -0
- package/dist/esm/modules/subscription.d.ts +33 -0
- package/dist/esm/modules/subscription.d.ts.map +1 -0
- package/dist/esm/modules/tools.d.ts +182 -0
- package/dist/esm/modules/tools.d.ts.map +1 -0
- package/dist/esm/modules/vault.d.ts +240 -0
- package/dist/esm/modules/vault.d.ts.map +1 -0
- package/dist/esm/parser/client.d.ts +123 -0
- package/dist/esm/parser/client.d.ts.map +1 -0
- package/dist/esm/parser/complete.d.ts +90 -0
- package/dist/esm/parser/complete.d.ts.map +1 -0
- package/{src/parser/index.ts → dist/esm/parser/index.d.ts} +6 -37
- package/dist/esm/parser/index.d.ts.map +1 -0
- package/dist/esm/parser/inner.d.ts +114 -0
- package/dist/esm/parser/inner.d.ts.map +1 -0
- package/{src/parser/instructions.ts → dist/esm/parser/instructions.d.ts} +4 -63
- package/dist/esm/parser/instructions.d.ts.map +1 -0
- package/dist/esm/parser/transaction.d.ts +77 -0
- package/dist/esm/parser/transaction.d.ts.map +1 -0
- package/dist/esm/parser/types.d.ts +154 -0
- package/dist/esm/parser/types.d.ts.map +1 -0
- package/{src/pda/index.ts → dist/esm/pda/index.d.ts} +33 -442
- package/dist/esm/pda/index.d.ts.map +1 -0
- package/dist/esm/pdas/index.d.ts +37 -0
- package/dist/esm/pdas/index.d.ts.map +1 -0
- package/dist/esm/pdas/index.js +101 -0
- package/dist/esm/pdas/index.js.map +1 -0
- package/dist/esm/plugin/index.d.ts +171 -0
- package/dist/esm/plugin/index.d.ts.map +1 -0
- package/dist/esm/plugin/protocols.d.ts +152 -0
- package/dist/esm/plugin/protocols.d.ts.map +1 -0
- package/dist/esm/plugin/schemas.d.ts +829 -0
- package/dist/esm/plugin/schemas.d.ts.map +1 -0
- package/dist/esm/postgres/adapter.d.ts +355 -0
- package/dist/esm/postgres/adapter.d.ts.map +1 -0
- package/dist/esm/postgres/index.d.ts +24 -0
- package/dist/esm/postgres/index.d.ts.map +1 -0
- package/dist/esm/postgres/serializers.d.ts +30 -0
- package/dist/esm/postgres/serializers.d.ts.map +1 -0
- package/dist/esm/postgres/sync.d.ts +156 -0
- package/dist/esm/postgres/sync.d.ts.map +1 -0
- package/dist/esm/postgres/types.d.ts +167 -0
- package/dist/esm/postgres/types.d.ts.map +1 -0
- package/dist/esm/registries/builder.d.ts +340 -0
- package/dist/esm/registries/builder.d.ts.map +1 -0
- package/dist/esm/registries/discovery.d.ts +333 -0
- package/dist/esm/registries/discovery.d.ts.map +1 -0
- package/dist/esm/registries/fairscale.d.ts +680 -0
- package/dist/esm/registries/fairscale.d.ts.map +1 -0
- package/dist/esm/registries/fairscale.js +1 -1
- package/dist/esm/registries/fairscale.js.map +1 -1
- package/dist/esm/registries/index.d.ts +52 -0
- package/dist/esm/registries/index.d.ts.map +1 -0
- package/dist/esm/registries/metaplex-bridge.d.ts +489 -0
- package/dist/esm/registries/metaplex-bridge.d.ts.map +1 -0
- package/dist/esm/registries/metaplex-bridge.js +1 -1
- package/dist/esm/registries/metaplex-bridge.js.map +1 -1
- package/dist/esm/registries/session.d.ts +323 -0
- package/dist/esm/registries/session.d.ts.map +1 -0
- package/dist/esm/registries/x402.d.ts +530 -0
- package/dist/esm/registries/x402.d.ts.map +1 -0
- package/dist/esm/types/accounts.d.ts +765 -0
- package/dist/esm/types/accounts.d.ts.map +1 -0
- package/dist/esm/types/common.d.ts +166 -0
- package/dist/esm/types/common.d.ts.map +1 -0
- package/dist/esm/types/endpoint.d.ts +161 -0
- package/dist/esm/types/endpoint.d.ts.map +1 -0
- package/dist/esm/types/enums.d.ts +353 -0
- package/dist/esm/types/enums.d.ts.map +1 -0
- package/dist/esm/types/index.d.ts +29 -0
- package/dist/esm/types/index.d.ts.map +1 -0
- package/dist/esm/types/instructions.d.ts +400 -0
- package/dist/esm/types/instructions.d.ts.map +1 -0
- package/dist/esm/types.d.ts +236 -0
- package/dist/esm/types.d.ts.map +1 -0
- package/dist/esm/types.js +40 -0
- package/dist/esm/types.js.map +1 -0
- package/dist/esm/utils/anchor-errors.d.ts +61 -0
- package/dist/esm/utils/anchor-errors.d.ts.map +1 -0
- package/dist/esm/utils/endpoint-validator.d.ts +110 -0
- package/dist/esm/utils/endpoint-validator.d.ts.map +1 -0
- package/dist/esm/utils/escrow-validation.d.ts +145 -0
- package/dist/esm/utils/escrow-validation.d.ts.map +1 -0
- package/dist/esm/utils/escrow-validation.js +1 -1
- package/dist/esm/utils/escrow-validation.js.map +1 -1
- package/{src/utils/hash.ts → dist/esm/utils/hash.d.ts} +4 -42
- package/dist/esm/utils/hash.d.ts.map +1 -0
- package/dist/esm/utils/index.d.ts +6 -0
- package/dist/esm/utils/index.d.ts.map +1 -0
- package/dist/esm/utils/index.js +16 -33
- package/dist/esm/utils/index.js.map +1 -1
- package/dist/esm/utils/merchant-validator.d.ts +176 -0
- package/dist/esm/utils/merchant-validator.d.ts.map +1 -0
- package/dist/esm/utils/merchant-validator.js +1 -1
- package/dist/esm/utils/merchant-validator.js.map +1 -1
- package/dist/esm/utils/network-normalizer.d.ts +120 -0
- package/dist/esm/utils/network-normalizer.d.ts.map +1 -0
- package/dist/esm/utils/priority-fee.d.ts +205 -0
- package/dist/esm/utils/priority-fee.d.ts.map +1 -0
- package/dist/esm/utils/rpc-strategy.d.ts +172 -0
- package/dist/esm/utils/rpc-strategy.d.ts.map +1 -0
- package/dist/esm/utils/schemas.d.ts +351 -0
- package/dist/esm/utils/schemas.d.ts.map +1 -0
- package/{src/utils/serialization.ts → dist/esm/utils/serialization.d.ts} +3 -32
- package/dist/esm/utils/serialization.d.ts.map +1 -0
- package/dist/esm/utils/validate.d.ts +66 -0
- package/dist/esm/utils/validate.d.ts.map +1 -0
- package/dist/esm/utils/validate.js +221 -0
- package/dist/esm/utils/validate.js.map +1 -0
- package/{src/utils/validation.ts → dist/esm/utils/validation.d.ts} +2 -9
- package/dist/esm/utils/validation.d.ts.map +1 -0
- package/{src/utils/volume-curve.ts → dist/esm/utils/volume-curve.d.ts} +2 -73
- package/dist/esm/utils/volume-curve.d.ts.map +1 -0
- package/dist/esm/utils/volume-curve.js +1 -1
- package/dist/esm/utils/volume-curve.js.map +1 -1
- package/dist/esm/utils/x402-direct.d.ts +114 -0
- package/dist/esm/utils/x402-direct.d.ts.map +1 -0
- package/dist/types/constants/seeds.d.ts +2 -0
- package/dist/types/constants/seeds.d.ts.map +1 -1
- package/dist/types/core/client.d.ts +21 -6
- package/dist/types/core/client.d.ts.map +1 -1
- package/dist/types/errors/index.d.ts +59 -0
- package/dist/types/errors/index.d.ts.map +1 -1
- package/dist/types/index.d.ts +3 -2
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/modules/agent.d.ts +9 -19
- package/dist/types/modules/agent.d.ts.map +1 -1
- package/dist/types/modules/attestation.d.ts.map +1 -1
- package/dist/types/modules/base.d.ts +54 -0
- package/dist/types/modules/base.d.ts.map +1 -1
- package/dist/types/modules/escrow-v2.d.ts +117 -1
- package/dist/types/modules/escrow-v2.d.ts.map +1 -1
- package/dist/types/modules/index.d.ts +1 -2
- package/dist/types/modules/index.d.ts.map +1 -1
- package/dist/types/modules/receipt.d.ts +14 -0
- package/dist/types/modules/receipt.d.ts.map +1 -1
- package/dist/types/modules/subscription.d.ts.map +1 -1
- package/dist/types/modules/tools.d.ts +0 -10
- package/dist/types/modules/tools.d.ts.map +1 -1
- package/dist/types/modules/vault.d.ts.map +1 -1
- package/dist/types/pda/index.d.ts +17 -0
- package/dist/types/pda/index.d.ts.map +1 -1
- package/dist/types/plugin/index.d.ts.map +1 -1
- package/dist/types/registries/builder.d.ts +2 -9
- package/dist/types/registries/builder.d.ts.map +1 -1
- package/dist/types/registries/metaplex-bridge.d.ts.map +1 -1
- package/dist/types/registries/session.d.ts +3 -9
- package/dist/types/registries/session.d.ts.map +1 -1
- package/dist/types/registries/x402.d.ts +2 -9
- package/dist/types/registries/x402.d.ts.map +1 -1
- package/dist/types/types/accounts.d.ts +52 -0
- package/dist/types/types/accounts.d.ts.map +1 -1
- package/dist/types/types/index.d.ts +1 -1
- package/dist/types/types/index.d.ts.map +1 -1
- package/dist/types/utils/rpc-strategy.d.ts +7 -0
- package/dist/types/utils/rpc-strategy.d.ts.map +1 -1
- package/package.json +59 -183
- package/src/constants/addresses.ts +0 -162
- package/src/constants/index.ts +0 -69
- package/src/constants/limits.ts +0 -165
- package/src/constants/seeds.ts +0 -85
- package/src/core/client.ts +0 -583
- package/src/core/connection.ts +0 -461
- package/src/errors/index.ts +0 -346
- package/src/events/geyser.ts +0 -384
- package/src/events/index.ts +0 -335
- package/src/events/yellowstone.d.ts +0 -7
- package/src/idl/synapse_agent_sap.json +0 -14595
- package/src/index.ts +0 -421
- package/src/modules/agent.ts +0 -319
- package/src/modules/attestation.ts +0 -168
- package/src/modules/base.ts +0 -247
- package/src/modules/escrow-v2.ts +0 -871
- package/src/modules/escrow.ts +0 -439
- package/src/modules/feedback.ts +0 -186
- package/src/modules/indexing.ts +0 -444
- package/src/modules/ledger.ts +0 -262
- package/src/modules/receipt.ts +0 -212
- package/src/modules/staking.ts +0 -223
- package/src/modules/subscription.ts +0 -147
- package/src/modules/tools.ts +0 -454
- package/src/modules/vault.ts +0 -558
- package/src/parser/client.ts +0 -211
- package/src/parser/complete.ts +0 -232
- package/src/parser/inner.ts +0 -255
- package/src/parser/transaction.ts +0 -200
- package/src/parser/types.ts +0 -182
- package/src/plugin/index.ts +0 -1224
- package/src/plugin/protocols.ts +0 -404
- package/src/plugin/schemas.ts +0 -941
- package/src/postgres/adapter.ts +0 -904
- package/src/postgres/index.ts +0 -59
- package/src/postgres/schema.sql +0 -683
- package/src/postgres/serializers.ts +0 -485
- package/src/postgres/sync.ts +0 -340
- package/src/postgres/types.ts +0 -245
- package/src/registries/builder.ts +0 -607
- package/src/registries/discovery.ts +0 -572
- package/src/registries/fairscale.ts +0 -1278
- package/src/registries/index.ts +0 -143
- package/src/registries/metaplex-bridge.ts +0 -1199
- package/src/registries/session.ts +0 -613
- package/src/registries/x402.ts +0 -1048
- package/src/types/accounts.ts +0 -858
- package/src/types/common.ts +0 -187
- package/src/types/endpoint.ts +0 -181
- package/src/types/enums.ts +0 -333
- package/src/types/index.ts +0 -121
- package/src/types/instructions.ts +0 -453
- package/src/utils/anchor-errors.ts +0 -461
- package/src/utils/endpoint-validator.ts +0 -300
- package/src/utils/escrow-validation.ts +0 -301
- package/src/utils/index.ts +0 -118
- package/src/utils/merchant-validator.ts +0 -359
- package/src/utils/network-normalizer.ts +0 -240
- package/src/utils/priority-fee.ts +0 -325
- package/src/utils/rpc-strategy.ts +0 -322
- package/src/utils/schemas.ts +0 -359
- package/src/utils/x402-direct.ts +0 -370
- /package/dist/{types → esm}/modules/escrow.d.ts +0 -0
- /package/dist/{types → esm}/modules/escrow.d.ts.map +0 -0
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
/** Generic SDK error */
|
|
2
|
+
export declare class SapError extends Error {
|
|
3
|
+
constructor(message: string);
|
|
4
|
+
}
|
|
5
|
+
/** Validation-specific SDK error */
|
|
6
|
+
export declare class SapValidationError extends Error {
|
|
7
|
+
constructor(message: string);
|
|
8
|
+
}
|
|
9
|
+
/** All v0.13 SapError variants with recovery hints */
|
|
10
|
+
export declare enum SapErrorCode {
|
|
11
|
+
NameTooLong = 6000,
|
|
12
|
+
NameTooShort = 6001,
|
|
13
|
+
InvalidEndpoint = 6002,
|
|
14
|
+
EndpointTooLong = 6003,
|
|
15
|
+
InvalidDIDHash = 6004,
|
|
16
|
+
AgentNotInitialized = 6005,
|
|
17
|
+
AgentAlreadyInitialized = 6006,
|
|
18
|
+
AgentClosed = 6007,
|
|
19
|
+
NameEmpty = 6010,
|
|
20
|
+
NameWhitespace = 6011,
|
|
21
|
+
DescriptionTooLong = 6012,
|
|
22
|
+
CategoryOutOfRange = 6013,
|
|
23
|
+
ToolNameExists = 6014,
|
|
24
|
+
ToolNotFound = 6015,
|
|
25
|
+
CallerNotAgentOwner = 6016,
|
|
26
|
+
CallerNotToolOwner = 6017,
|
|
27
|
+
ToolCategoryMismatch = 6018,
|
|
28
|
+
StakeBelowMinimum = 6020,
|
|
29
|
+
NotStaked = 6021,
|
|
30
|
+
UnstakeTooSoon = 6022,
|
|
31
|
+
UnstakeExceedsStake = 6023,
|
|
32
|
+
AlreadyStaked = 6024,
|
|
33
|
+
UnstakeWindowNotOpen = 6025,
|
|
34
|
+
UnstakeAlreadyPending = 6026,
|
|
35
|
+
CannotCloseAgentWithActiveEscrows = 6027,
|
|
36
|
+
StakeNotFound = 6028,
|
|
37
|
+
AgentStatsNotFound = 6029,
|
|
38
|
+
InsufficientStake = 6030,
|
|
39
|
+
InsufficientEscrowBalance = 6032,
|
|
40
|
+
EscrowNotFound = 6033,
|
|
41
|
+
EscrowNotForAgent = 6034,
|
|
42
|
+
EscrowNotForDepositor = 6035,
|
|
43
|
+
AmountMustBePositive = 6036,
|
|
44
|
+
PricePerCallMustBePositive = 6037,
|
|
45
|
+
InvalidEscrowNonce = 6038,
|
|
46
|
+
InvalidVolumeCurve = 6039,
|
|
47
|
+
VolumeCurveNotDescending = 6040,
|
|
48
|
+
TooManyVolumeCurvePoints = 6041,
|
|
49
|
+
SettlementNotPending = 6042,
|
|
50
|
+
SettlementAlreadyFinalized = 6043,
|
|
51
|
+
DisputeWindowNotExpired = 6044,
|
|
52
|
+
DisputeWindowExpired = 6045,
|
|
53
|
+
NotDepositor = 6046,
|
|
54
|
+
DisputeAlreadyFiled = 6047,
|
|
55
|
+
DisputeStillOpen = 6048,
|
|
56
|
+
NotArbiter = 6049,
|
|
57
|
+
InvalidArbiter = 6050,
|
|
58
|
+
ArbiterRequired = 6051,
|
|
59
|
+
CoSignerRequired = 6052,
|
|
60
|
+
InvalidCoSigner = 6053,
|
|
61
|
+
InvalidDisputeOutcome = 6054,
|
|
62
|
+
EscrowEmpty = 6055,
|
|
63
|
+
EscrowAlreadyExpired = 6056,
|
|
64
|
+
EscrowExpired = 6057,
|
|
65
|
+
EscrowNonceReused = 6058,
|
|
66
|
+
ReceiptBatchNotFound = 6060,
|
|
67
|
+
ReceiptTreeEmpty = 6061,
|
|
68
|
+
ReceiptNotFound = 6062,
|
|
69
|
+
ReceiptAlreadyDisputed = 6063,
|
|
70
|
+
ReceiptNotInWindow = 6064,
|
|
71
|
+
InvalidReceiptProof = 6065,
|
|
72
|
+
InvalidMerkleProof = 6066,
|
|
73
|
+
NotAgentOwner = 6067,
|
|
74
|
+
SubscriptionNotFound = 6070,
|
|
75
|
+
NotSubscriber = 6071,
|
|
76
|
+
SubscriptionInsufficientBalance = 6072,
|
|
77
|
+
SubscriptionIntervalOverflow = 6073,
|
|
78
|
+
SubscriptionDurationTooLong = 6074,
|
|
79
|
+
PendingAmountMismatch = 6080,
|
|
80
|
+
MaxCallsPerSettlementExceeded = 6081,
|
|
81
|
+
InvalidVolumeCurvePrice = 6082,
|
|
82
|
+
EscrowCoverageExceeded = 6083,
|
|
83
|
+
CoSignerIsAgentWallet = 6084,
|
|
84
|
+
PendingSettlementExists = 6085,
|
|
85
|
+
TokenAccountOwnerMismatch = 6086,
|
|
86
|
+
MaxReceiptProofExceeded = 6087,
|
|
87
|
+
MaxMerkleDepthExceeded = 6088,
|
|
88
|
+
StakeSlashLocksUnstake = 6089,
|
|
89
|
+
ArithmeticOverflow = 6300,
|
|
90
|
+
VaultNotFound = 6350,
|
|
91
|
+
VaultAlreadyInitialized = 6351,
|
|
92
|
+
VaultNotInitialized = 6352,
|
|
93
|
+
NotVaultOwner = 6353,
|
|
94
|
+
NotDelegate = 6354,
|
|
95
|
+
DelegateExpired = 6355,
|
|
96
|
+
InvalidPermissions = 6356,
|
|
97
|
+
SessionNotFound = 6357,
|
|
98
|
+
EpochNotFound = 6358,
|
|
99
|
+
VaultAlreadyOpen = 6359,
|
|
100
|
+
InvalidSequence = 6360,
|
|
101
|
+
FragmentTooLarge = 6361,
|
|
102
|
+
VaultClosed = 6362,
|
|
103
|
+
InsufficientVaultBalance = 6363
|
|
104
|
+
}
|
|
105
|
+
export interface SapErrorInfo {
|
|
106
|
+
code: SapErrorCode;
|
|
107
|
+
name: string;
|
|
108
|
+
message: string;
|
|
109
|
+
recovery: string;
|
|
110
|
+
}
|
|
111
|
+
/** Decode an Anchor transaction error into structured info */
|
|
112
|
+
export declare function decodeSapError(err: unknown): SapErrorInfo;
|
|
113
|
+
/** Is this error retryable? */
|
|
114
|
+
export declare function isRetryableError(err: SapErrorInfo): boolean;
|
|
115
|
+
/** Is this a client-side validation error that should have been caught before sending?
|
|
116
|
+
* If true, the SDK's validate functions have a bug.
|
|
117
|
+
*/
|
|
118
|
+
export declare function isClientValidationFailure(err: SapErrorInfo): boolean;
|
|
119
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/errors.ts"],"names":[],"mappings":"AAAA,wBAAwB;AACxB,qBAAa,QAAS,SAAQ,KAAK;gBACrB,OAAO,EAAE,MAAM;CAC5B;AAED,oCAAoC;AACpC,qBAAa,kBAAmB,SAAQ,KAAK;gBAC/B,OAAO,EAAE,MAAM;CAC5B;AASD,sDAAsD;AACtD,oBAAY,YAAY;IAEtB,WAAW,OAAO;IAClB,YAAY,OAAO;IACnB,eAAe,OAAO;IACtB,eAAe,OAAO;IACtB,cAAc,OAAO;IACrB,mBAAmB,OAAO;IAC1B,uBAAuB,OAAO;IAC9B,WAAW,OAAO;IAGlB,SAAS,OAAO;IAChB,cAAc,OAAO;IACrB,kBAAkB,OAAO;IACzB,kBAAkB,OAAO;IACzB,cAAc,OAAO;IACrB,YAAY,OAAO;IACnB,mBAAmB,OAAO;IAC1B,kBAAkB,OAAO;IACzB,oBAAoB,OAAO;IAG3B,iBAAiB,OAAO;IACxB,SAAS,OAAO;IAChB,cAAc,OAAO;IACrB,mBAAmB,OAAO;IAC1B,aAAa,OAAO;IACpB,oBAAoB,OAAO;IAC3B,qBAAqB,OAAO;IAC5B,iCAAiC,OAAO;IACxC,aAAa,OAAO;IACpB,kBAAkB,OAAO;IACzB,iBAAiB,OAAO;IAGxB,yBAAyB,OAAO;IAChC,cAAc,OAAO;IACrB,iBAAi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B,WAAW,OAAO;IAClB,wBAAwB,OAAO;CAChC;AAED,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,YAAY,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAwED,8DAA8D;AAC9D,wBAAgB,cAAc,CAAC,GAAG,EAAE,OAAO,GAAG,YAAY,CAmCzD;AAED,+BAA+B;AAC/B,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,YAAY,GAAG,OAAO,CAO3D;AAED;;GAEG;AACH,wBAAgB,yBAAyB,CAAC,GAAG,EAAE,YAAY,GAAG,OAAO,CAgBpE"}
|
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
/** Generic SDK error */
|
|
2
|
+
export class SapError extends Error {
|
|
3
|
+
constructor(message) { super(message); this.name = "SapError"; }
|
|
4
|
+
}
|
|
5
|
+
/** Validation-specific SDK error */
|
|
6
|
+
export class SapValidationError extends Error {
|
|
7
|
+
constructor(message) { super(message); this.name = "SapValidationError"; }
|
|
8
|
+
}
|
|
9
|
+
// ================================================================
|
|
10
|
+
// synapse-sap-sdk / src/errors.ts
|
|
11
|
+
// On-chain error codes ↔ human-readable messages + recovery actions
|
|
12
|
+
// ================================================================
|
|
13
|
+
/** All v0.13 SapError variants with recovery hints */
|
|
14
|
+
export var SapErrorCode;
|
|
15
|
+
(function (SapErrorCode) {
|
|
16
|
+
// ── Agent ──
|
|
17
|
+
SapErrorCode[SapErrorCode["NameTooLong"] = 6000] = "NameTooLong";
|
|
18
|
+
SapErrorCode[SapErrorCode["NameTooShort"] = 6001] = "NameTooShort";
|
|
19
|
+
SapErrorCode[SapErrorCode["InvalidEndpoint"] = 6002] = "InvalidEndpoint";
|
|
20
|
+
SapErrorCode[SapErrorCode["EndpointTooLong"] = 6003] = "EndpointTooLong";
|
|
21
|
+
SapErrorCode[SapErrorCode["InvalidDIDHash"] = 6004] = "InvalidDIDHash";
|
|
22
|
+
SapErrorCode[SapErrorCode["AgentNotInitialized"] = 6005] = "AgentNotInitialized";
|
|
23
|
+
SapErrorCode[SapErrorCode["AgentAlreadyInitialized"] = 6006] = "AgentAlreadyInitialized";
|
|
24
|
+
SapErrorCode[SapErrorCode["AgentClosed"] = 6007] = "AgentClosed";
|
|
25
|
+
// ── Tool / Registry ──
|
|
26
|
+
SapErrorCode[SapErrorCode["NameEmpty"] = 6010] = "NameEmpty";
|
|
27
|
+
SapErrorCode[SapErrorCode["NameWhitespace"] = 6011] = "NameWhitespace";
|
|
28
|
+
SapErrorCode[SapErrorCode["DescriptionTooLong"] = 6012] = "DescriptionTooLong";
|
|
29
|
+
SapErrorCode[SapErrorCode["CategoryOutOfRange"] = 6013] = "CategoryOutOfRange";
|
|
30
|
+
SapErrorCode[SapErrorCode["ToolNameExists"] = 6014] = "ToolNameExists";
|
|
31
|
+
SapErrorCode[SapErrorCode["ToolNotFound"] = 6015] = "ToolNotFound";
|
|
32
|
+
SapErrorCode[SapErrorCode["CallerNotAgentOwner"] = 6016] = "CallerNotAgentOwner";
|
|
33
|
+
SapErrorCode[SapErrorCode["CallerNotToolOwner"] = 6017] = "CallerNotToolOwner";
|
|
34
|
+
SapErrorCode[SapErrorCode["ToolCategoryMismatch"] = 6018] = "ToolCategoryMismatch";
|
|
35
|
+
// ── Stake ──
|
|
36
|
+
SapErrorCode[SapErrorCode["StakeBelowMinimum"] = 6020] = "StakeBelowMinimum";
|
|
37
|
+
SapErrorCode[SapErrorCode["NotStaked"] = 6021] = "NotStaked";
|
|
38
|
+
SapErrorCode[SapErrorCode["UnstakeTooSoon"] = 6022] = "UnstakeTooSoon";
|
|
39
|
+
SapErrorCode[SapErrorCode["UnstakeExceedsStake"] = 6023] = "UnstakeExceedsStake";
|
|
40
|
+
SapErrorCode[SapErrorCode["AlreadyStaked"] = 6024] = "AlreadyStaked";
|
|
41
|
+
SapErrorCode[SapErrorCode["UnstakeWindowNotOpen"] = 6025] = "UnstakeWindowNotOpen";
|
|
42
|
+
SapErrorCode[SapErrorCode["UnstakeAlreadyPending"] = 6026] = "UnstakeAlreadyPending";
|
|
43
|
+
SapErrorCode[SapErrorCode["CannotCloseAgentWithActiveEscrows"] = 6027] = "CannotCloseAgentWithActiveEscrows";
|
|
44
|
+
SapErrorCode[SapErrorCode["StakeNotFound"] = 6028] = "StakeNotFound";
|
|
45
|
+
SapErrorCode[SapErrorCode["AgentStatsNotFound"] = 6029] = "AgentStatsNotFound";
|
|
46
|
+
SapErrorCode[SapErrorCode["InsufficientStake"] = 6030] = "InsufficientStake";
|
|
47
|
+
// ── Escrow ──
|
|
48
|
+
SapErrorCode[SapErrorCode["InsufficientEscrowBalance"] = 6032] = "InsufficientEscrowBalance";
|
|
49
|
+
SapErrorCode[SapErrorCode["EscrowNotFound"] = 6033] = "EscrowNotFound";
|
|
50
|
+
SapErrorCode[SapErrorCode["EscrowNotForAgent"] = 6034] = "EscrowNotForAgent";
|
|
51
|
+
SapErrorCode[SapErrorCode["EscrowNotForDepositor"] = 6035] = "EscrowNotForDepositor";
|
|
52
|
+
SapErrorCode[SapErrorCode["AmountMustBePositive"] = 6036] = "AmountMustBePositive";
|
|
53
|
+
SapErrorCode[SapErrorCode["PricePerCallMustBePositive"] = 6037] = "PricePerCallMustBePositive";
|
|
54
|
+
SapErrorCode[SapErrorCode["InvalidEscrowNonce"] = 6038] = "InvalidEscrowNonce";
|
|
55
|
+
SapErrorCode[SapErrorCode["InvalidVolumeCurve"] = 6039] = "InvalidVolumeCurve";
|
|
56
|
+
SapErrorCode[SapErrorCode["VolumeCurveNotDescending"] = 6040] = "VolumeCurveNotDescending";
|
|
57
|
+
SapErrorCode[SapErrorCode["TooManyVolumeCurvePoints"] = 6041] = "TooManyVolumeCurvePoints";
|
|
58
|
+
SapErrorCode[SapErrorCode["SettlementNotPending"] = 6042] = "SettlementNotPending";
|
|
59
|
+
SapErrorCode[SapErrorCode["SettlementAlreadyFinalized"] = 6043] = "SettlementAlreadyFinalized";
|
|
60
|
+
SapErrorCode[SapErrorCode["DisputeWindowNotExpired"] = 6044] = "DisputeWindowNotExpired";
|
|
61
|
+
SapErrorCode[SapErrorCode["DisputeWindowExpired"] = 6045] = "DisputeWindowExpired";
|
|
62
|
+
SapErrorCode[SapErrorCode["NotDepositor"] = 6046] = "NotDepositor";
|
|
63
|
+
SapErrorCode[SapErrorCode["DisputeAlreadyFiled"] = 6047] = "DisputeAlreadyFiled";
|
|
64
|
+
SapErrorCode[SapErrorCode["DisputeStillOpen"] = 6048] = "DisputeStillOpen";
|
|
65
|
+
SapErrorCode[SapErrorCode["NotArbiter"] = 6049] = "NotArbiter";
|
|
66
|
+
SapErrorCode[SapErrorCode["InvalidArbiter"] = 6050] = "InvalidArbiter";
|
|
67
|
+
SapErrorCode[SapErrorCode["ArbiterRequired"] = 6051] = "ArbiterRequired";
|
|
68
|
+
SapErrorCode[SapErrorCode["CoSignerRequired"] = 6052] = "CoSignerRequired";
|
|
69
|
+
SapErrorCode[SapErrorCode["InvalidCoSigner"] = 6053] = "InvalidCoSigner";
|
|
70
|
+
SapErrorCode[SapErrorCode["InvalidDisputeOutcome"] = 6054] = "InvalidDisputeOutcome";
|
|
71
|
+
SapErrorCode[SapErrorCode["EscrowEmpty"] = 6055] = "EscrowEmpty";
|
|
72
|
+
SapErrorCode[SapErrorCode["EscrowAlreadyExpired"] = 6056] = "EscrowAlreadyExpired";
|
|
73
|
+
SapErrorCode[SapErrorCode["EscrowExpired"] = 6057] = "EscrowExpired";
|
|
74
|
+
SapErrorCode[SapErrorCode["EscrowNonceReused"] = 6058] = "EscrowNonceReused";
|
|
75
|
+
// ── Receipt ──
|
|
76
|
+
SapErrorCode[SapErrorCode["ReceiptBatchNotFound"] = 6060] = "ReceiptBatchNotFound";
|
|
77
|
+
SapErrorCode[SapErrorCode["ReceiptTreeEmpty"] = 6061] = "ReceiptTreeEmpty";
|
|
78
|
+
SapErrorCode[SapErrorCode["ReceiptNotFound"] = 6062] = "ReceiptNotFound";
|
|
79
|
+
SapErrorCode[SapErrorCode["ReceiptAlreadyDisputed"] = 6063] = "ReceiptAlreadyDisputed";
|
|
80
|
+
SapErrorCode[SapErrorCode["ReceiptNotInWindow"] = 6064] = "ReceiptNotInWindow";
|
|
81
|
+
SapErrorCode[SapErrorCode["InvalidReceiptProof"] = 6065] = "InvalidReceiptProof";
|
|
82
|
+
SapErrorCode[SapErrorCode["InvalidMerkleProof"] = 6066] = "InvalidMerkleProof";
|
|
83
|
+
SapErrorCode[SapErrorCode["NotAgentOwner"] = 6067] = "NotAgentOwner";
|
|
84
|
+
// ── Subscription ──
|
|
85
|
+
SapErrorCode[SapErrorCode["SubscriptionNotFound"] = 6070] = "SubscriptionNotFound";
|
|
86
|
+
SapErrorCode[SapErrorCode["NotSubscriber"] = 6071] = "NotSubscriber";
|
|
87
|
+
SapErrorCode[SapErrorCode["SubscriptionInsufficientBalance"] = 6072] = "SubscriptionInsufficientBalance";
|
|
88
|
+
SapErrorCode[SapErrorCode["SubscriptionIntervalOverflow"] = 6073] = "SubscriptionIntervalOverflow";
|
|
89
|
+
SapErrorCode[SapErrorCode["SubscriptionDurationTooLong"] = 6074] = "SubscriptionDurationTooLong";
|
|
90
|
+
// ── Dispute / Security (v0.13) ──
|
|
91
|
+
SapErrorCode[SapErrorCode["PendingAmountMismatch"] = 6080] = "PendingAmountMismatch";
|
|
92
|
+
SapErrorCode[SapErrorCode["MaxCallsPerSettlementExceeded"] = 6081] = "MaxCallsPerSettlementExceeded";
|
|
93
|
+
SapErrorCode[SapErrorCode["InvalidVolumeCurvePrice"] = 6082] = "InvalidVolumeCurvePrice";
|
|
94
|
+
SapErrorCode[SapErrorCode["EscrowCoverageExceeded"] = 6083] = "EscrowCoverageExceeded";
|
|
95
|
+
SapErrorCode[SapErrorCode["CoSignerIsAgentWallet"] = 6084] = "CoSignerIsAgentWallet";
|
|
96
|
+
SapErrorCode[SapErrorCode["PendingSettlementExists"] = 6085] = "PendingSettlementExists";
|
|
97
|
+
SapErrorCode[SapErrorCode["TokenAccountOwnerMismatch"] = 6086] = "TokenAccountOwnerMismatch";
|
|
98
|
+
SapErrorCode[SapErrorCode["MaxReceiptProofExceeded"] = 6087] = "MaxReceiptProofExceeded";
|
|
99
|
+
SapErrorCode[SapErrorCode["MaxMerkleDepthExceeded"] = 6088] = "MaxMerkleDepthExceeded";
|
|
100
|
+
SapErrorCode[SapErrorCode["StakeSlashLocksUnstake"] = 6089] = "StakeSlashLocksUnstake";
|
|
101
|
+
// ── Math ──
|
|
102
|
+
SapErrorCode[SapErrorCode["ArithmeticOverflow"] = 6300] = "ArithmeticOverflow";
|
|
103
|
+
// ── Vault ──
|
|
104
|
+
SapErrorCode[SapErrorCode["VaultNotFound"] = 6350] = "VaultNotFound";
|
|
105
|
+
SapErrorCode[SapErrorCode["VaultAlreadyInitialized"] = 6351] = "VaultAlreadyInitialized";
|
|
106
|
+
SapErrorCode[SapErrorCode["VaultNotInitialized"] = 6352] = "VaultNotInitialized";
|
|
107
|
+
SapErrorCode[SapErrorCode["NotVaultOwner"] = 6353] = "NotVaultOwner";
|
|
108
|
+
SapErrorCode[SapErrorCode["NotDelegate"] = 6354] = "NotDelegate";
|
|
109
|
+
SapErrorCode[SapErrorCode["DelegateExpired"] = 6355] = "DelegateExpired";
|
|
110
|
+
SapErrorCode[SapErrorCode["InvalidPermissions"] = 6356] = "InvalidPermissions";
|
|
111
|
+
SapErrorCode[SapErrorCode["SessionNotFound"] = 6357] = "SessionNotFound";
|
|
112
|
+
SapErrorCode[SapErrorCode["EpochNotFound"] = 6358] = "EpochNotFound";
|
|
113
|
+
SapErrorCode[SapErrorCode["VaultAlreadyOpen"] = 6359] = "VaultAlreadyOpen";
|
|
114
|
+
SapErrorCode[SapErrorCode["InvalidSequence"] = 6360] = "InvalidSequence";
|
|
115
|
+
SapErrorCode[SapErrorCode["FragmentTooLarge"] = 6361] = "FragmentTooLarge";
|
|
116
|
+
SapErrorCode[SapErrorCode["VaultClosed"] = 6362] = "VaultClosed";
|
|
117
|
+
SapErrorCode[SapErrorCode["InsufficientVaultBalance"] = 6363] = "InsufficientVaultBalance";
|
|
118
|
+
})(SapErrorCode || (SapErrorCode = {}));
|
|
119
|
+
const ERROR_MAP = {
|
|
120
|
+
[SapErrorCode.NameTooLong]: { code: SapErrorCode.NameTooLong, name: "NameTooLong", message: "Agent name exceeds 64 characters.", recovery: "Shorten the agent name to ≤64 chars." },
|
|
121
|
+
[SapErrorCode.NameTooShort]: { code: SapErrorCode.NameTooShort, name: "NameTooShort", message: "Agent name is too short.", recovery: "Use at least 3 characters for the agent name." },
|
|
122
|
+
[SapErrorCode.InvalidEndpoint]: { code: SapErrorCode.InvalidEndpoint, name: "InvalidEndpoint", message: "Endpoint URI must start with http:// or https://.", recovery: "Provide a valid HTTP or HTTPS URL." },
|
|
123
|
+
[SapErrorCode.EndpointTooLong]: { code: SapErrorCode.EndpointTooLong, name: "EndpointTooLong", message: "Endpoint URI exceeds 256 characters.", recovery: "Shorten the endpoint URL." },
|
|
124
|
+
[SapErrorCode.AgentClosed]: { code: SapErrorCode.AgentClosed, name: "AgentClosed", message: "Agent has been closed.", recovery: "Re-register the agent or use a different wallet." },
|
|
125
|
+
[SapErrorCode.CallerNotAgentOwner]: { code: SapErrorCode.CallerNotAgentOwner, name: "CallerNotAgentOwner", message: "Signer is not the agent owner.", recovery: "Sign with the wallet that owns the agent." },
|
|
126
|
+
[SapErrorCode.StakeBelowMinimum]: { code: SapErrorCode.StakeBelowMinimum, name: "StakeBelowMinimum", message: `Stake is below minimum (${1} SOL).`, recovery: "Increase the stake amount to at least 1 SOL." },
|
|
127
|
+
[SapErrorCode.NotStaked]: { code: SapErrorCode.NotStaked, name: "NotStaked", message: "Wallet has no stake account.", recovery: "Call stake() first to create a stake account." },
|
|
128
|
+
[SapErrorCode.UnstakeTooSoon]: { code: SapErrorCode.UnstakeTooSoon, name: "UnstakeTooSoon", message: "Cannot unstake yet — wait for the cooldown period.", recovery: "Wait 14 days after requesting unstake before completing." },
|
|
129
|
+
[SapErrorCode.UnstakeExceedsStake]: { code: SapErrorCode.UnstakeExceedsStake, name: "UnstakeExceedsStake", message: "Unstake amount exceeds staked amount.", recovery: "Reduce unstake amount to ≤ staked amount." },
|
|
130
|
+
[SapErrorCode.CannotCloseAgentWithActiveEscrows]: { code: SapErrorCode.CannotCloseAgentWithActiveEscrows, name: "CannotCloseAgentWithActiveEscrows", message: "Agent has active escrows.", recovery: "Close all escrows or wait for expiry before closing agent." },
|
|
131
|
+
[SapErrorCode.InsufficientEscrowBalance]: { code: SapErrorCode.InsufficientEscrowBalance, name: "InsufficientEscrowBalance", message: "Escrow has insufficient balance for the operation.", recovery: "Deposit more funds or reduce the settlement/withdraw amount." },
|
|
132
|
+
[SapErrorCode.EscrowNotFound]: { code: SapErrorCode.EscrowNotFound, name: "EscrowNotFound", message: "Escrow account does not exist.", recovery: "Verify the PDA seeds or create the escrow first." },
|
|
133
|
+
[SapErrorCode.AmountMustBePositive]: { code: SapErrorCode.AmountMustBePositive, name: "AmountMustBePositive", message: "Amount must be > 0.", recovery: "Provide a positive amount." },
|
|
134
|
+
[SapErrorCode.PricePerCallMustBePositive]: { code: SapErrorCode.PricePerCallMustBePositive, name: "PricePerCallMustBePositive", message: "price_per_call must be > 0.", recovery: "Set price_per_call to a positive value." },
|
|
135
|
+
[SapErrorCode.InvalidVolumeCurve]: { code: SapErrorCode.InvalidVolumeCurve, name: "InvalidVolumeCurve", message: "Volume curve breakpoints are not strictly increasing.", recovery: "Ensure each breakpoint's after_calls > the previous." },
|
|
136
|
+
[SapErrorCode.VolumeCurveNotDescending]: { code: SapErrorCode.VolumeCurveNotDescending, name: "VolumeCurveNotDescending", message: "Volume curve prices are not non-increasing.", recovery: "Ensure each breakpoint's price ≤ previous." },
|
|
137
|
+
[SapErrorCode.TooManyVolumeCurvePoints]: { code: SapErrorCode.TooManyVolumeCurvePoints, name: "TooManyVolumeCurvePoints", message: "Volume curve exceeds max 10 points.", recovery: "Reduce volume curve to ≤10 breakpoints." },
|
|
138
|
+
[SapErrorCode.SettlementNotPending]: { code: SapErrorCode.SettlementNotPending, name: "SettlementNotPending", message: "Settlement is not in pending state.", recovery: "Verify the settlement index or file a dispute." },
|
|
139
|
+
[SapErrorCode.SettlementAlreadyFinalized]: { code: SapErrorCode.SettlementAlreadyFinalized, name: "SettlementAlreadyFinalized", message: "Settlement already finalized.", recovery: "Nothing to do — settlement is complete." },
|
|
140
|
+
[SapErrorCode.DisputeWindowNotExpired]: { code: SapErrorCode.DisputeWindowNotExpired, name: "DisputeWindowNotExpired", message: "Dispute window has not expired yet.", recovery: "Wait for the dispute window to close." },
|
|
141
|
+
[SapErrorCode.DisputeWindowExpired]: { code: SapErrorCode.DisputeWindowExpired, name: "DisputeWindowExpired", message: "Dispute window has expired.", recovery: "The deadline for filing a dispute has passed." },
|
|
142
|
+
[SapErrorCode.NotDepositor]: { code: SapErrorCode.NotDepositor, name: "NotDepositor", message: "Signer is not the depositor.", recovery: "Sign with the wallet that deposited into the escrow." },
|
|
143
|
+
[SapErrorCode.DisputeAlreadyFiled]: { code: SapErrorCode.DisputeAlreadyFiled, name: "DisputeAlreadyFiled", message: "A dispute has already been filed for this settlement.", recovery: "Wait for the dispute to resolve or file on a different settlement." },
|
|
144
|
+
[SapErrorCode.DisputeStillOpen]: { code: SapErrorCode.DisputeStillOpen, name: "DisputeStillOpen", message: "Dispute is still open.", recovery: "Wait for the dispute to reach a final outcome." },
|
|
145
|
+
[SapErrorCode.NotArbiter]: { code: SapErrorCode.NotArbiter, name: "NotArbiter", message: "Signer is not the designated arbiter.", recovery: "Sign with the arbiter wallet or wait for auto-resolution." },
|
|
146
|
+
[SapErrorCode.ArbiterRequired]: { code: SapErrorCode.ArbiterRequired, name: "ArbiterRequired", message: "Arbiter must be set for DisputeWindow mode.", recovery: "Provide a valid arbiter public key when creating the escrow." },
|
|
147
|
+
[SapErrorCode.CoSignerRequired]: { code: SapErrorCode.CoSignerRequired, name: "CoSignerRequired", message: "CoSigner must be set for CoSigned mode.", recovery: "Provide a valid co-signer public key when creating the escrow." },
|
|
148
|
+
[SapErrorCode.InvalidCoSigner]: { code: SapErrorCode.InvalidCoSigner, name: "InvalidCoSigner", message: "Invalid co-signer public key.", recovery: "Provide a valid public key for the co-signer." },
|
|
149
|
+
[SapErrorCode.InvalidDisputeOutcome]: { code: SapErrorCode.InvalidDisputeOutcome, name: "InvalidDisputeOutcome", message: "Invalid dispute outcome.", recovery: "Outcome must be DepositorWins (1), AgentWins (2), or Refunded (3)." },
|
|
150
|
+
[SapErrorCode.EscrowEmpty]: { code: SapErrorCode.EscrowEmpty, name: "EscrowEmpty", message: "Escrow balance is zero.", recovery: "Deposit funds before withdrawing or settling." },
|
|
151
|
+
[SapErrorCode.EscrowAlreadyExpired]: { code: SapErrorCode.EscrowAlreadyExpired, name: "EscrowAlreadyExpired", message: "Escrow has already expired at the time of creation.", recovery: "Set expires_at to a future timestamp or 0 (never)." },
|
|
152
|
+
[SapErrorCode.EscrowExpired]: { code: SapErrorCode.EscrowExpired, name: "EscrowExpired", message: "Escrow has expired.", recovery: "Create a new escrow or withdraw remaining balance." },
|
|
153
|
+
[SapErrorCode.ReceiptBatchNotFound]: { code: SapErrorCode.ReceiptBatchNotFound, name: "ReceiptBatchNotFound", message: "Receipt batch not found.", recovery: "Create a receipt batch first." },
|
|
154
|
+
[SapErrorCode.InvalidReceiptProof]: { code: SapErrorCode.InvalidReceiptProof, name: "InvalidReceiptProof", message: "Receipt proof does not verify.", recovery: "Verify the receipt hash and merkle proof are correct." },
|
|
155
|
+
[SapErrorCode.InvalidMerkleProof]: { code: SapErrorCode.InvalidMerkleProof, name: "InvalidMerkleProof", message: "Merkle proof structure is invalid.", recovery: "Check merkle proof depth (≤16) and sibling hashes." },
|
|
156
|
+
[SapErrorCode.SubscriptionNotFound]: { code: SapErrorCode.SubscriptionNotFound, name: "SubscriptionNotFound", message: "Subscription account does not exist.", recovery: "Create a subscription first." },
|
|
157
|
+
[SapErrorCode.NotSubscriber]: { code: SapErrorCode.NotSubscriber, name: "NotSubscriber", message: "Signer is not the subscriber.", recovery: "Sign with the wallet that created the subscription." },
|
|
158
|
+
[SapErrorCode.SubscriptionInsufficientBalance]: { code: SapErrorCode.SubscriptionInsufficientBalance, name: "SubscriptionInsufficientBalance", message: "Subscription has insufficient balance.", recovery: "Fund the subscription before claiming." },
|
|
159
|
+
[SapErrorCode.SubscriptionIntervalOverflow]: { code: SapErrorCode.SubscriptionIntervalOverflow, name: "SubscriptionIntervalOverflow", message: "Claimable intervals exceed u32 range.", recovery: "Claim in smaller batches." },
|
|
160
|
+
[SapErrorCode.SubscriptionDurationTooLong]: { code: SapErrorCode.SubscriptionDurationTooLong, name: "SubscriptionDurationTooLong", message: "Subscription duration exceeds 10 years.", recovery: "Reduce the subscription duration." },
|
|
161
|
+
[SapErrorCode.ArithmeticOverflow]: { code: SapErrorCode.ArithmeticOverflow, name: "ArithmeticOverflow", message: "Arithmetic operation overflow.", recovery: "Reduce amounts to stay within u64 range." },
|
|
162
|
+
[SapErrorCode.VaultNotFound]: { code: SapErrorCode.VaultNotFound, name: "VaultNotFound", message: "Vault account does not exist.", recovery: "Create a vault first." },
|
|
163
|
+
[SapErrorCode.VaultAlreadyInitialized]: { code: SapErrorCode.VaultAlreadyInitialized, name: "VaultAlreadyInitialized", message: "Vault is already initialized.", recovery: "Use the existing vault or close it first." },
|
|
164
|
+
[SapErrorCode.NotVaultOwner]: { code: SapErrorCode.NotVaultOwner, name: "NotVaultOwner", message: "Signer is not the vault owner.", recovery: "Sign with the agent wallet that owns the vault." },
|
|
165
|
+
[SapErrorCode.NotDelegate]: { code: SapErrorCode.NotDelegate, name: "NotDelegate", message: "Signer is not a vault delegate.", recovery: "Add the signer as a vault delegate first." },
|
|
166
|
+
[SapErrorCode.DelegateExpired]: { code: SapErrorCode.DelegateExpired, name: "DelegateExpired", message: "Vault delegate has expired.", recovery: "Renew the delegate or use the owner wallet." },
|
|
167
|
+
[SapErrorCode.InvalidPermissions]: { code: SapErrorCode.InvalidPermissions, name: "InvalidPermissions", message: "Invalid vault delegate permissions.", recovery: "Use a valid permission bitmask (1=inscribe, 2=close, 4=open)." },
|
|
168
|
+
[SapErrorCode.SessionNotFound]: { code: SapErrorCode.SessionNotFound, name: "SessionNotFound", message: "Session ledger does not exist.", recovery: "Create a session first." },
|
|
169
|
+
[SapErrorCode.EpochNotFound]: { code: SapErrorCode.EpochNotFound, name: "EpochNotFound", message: "Epoch page does not exist.", recovery: "Create an epoch first." },
|
|
170
|
+
[SapErrorCode.VaultAlreadyOpen]: { code: SapErrorCode.VaultAlreadyOpen, name: "VaultAlreadyOpen", message: "Vault is already open.", recovery: "Vault is already initialized — proceed with inscription." },
|
|
171
|
+
[SapErrorCode.InvalidSequence]: { code: SapErrorCode.InvalidSequence, name: "InvalidSequence", message: "Inscription sequence is invalid.", recovery: "Use the next expected sequence number." },
|
|
172
|
+
[SapErrorCode.FragmentTooLarge]: { code: SapErrorCode.FragmentTooLarge, name: "FragmentTooLarge", message: "Inscription fragment exceeds max size.", recovery: "Split the inscription into smaller fragments." },
|
|
173
|
+
[SapErrorCode.VaultClosed]: { code: SapErrorCode.VaultClosed, name: "VaultClosed", message: "Vault has been closed.", recovery: "Re-open the vault or create a new one." },
|
|
174
|
+
[SapErrorCode.InsufficientVaultBalance]: { code: SapErrorCode.InsufficientVaultBalance, name: "InsufficientVaultBalance", message: "Vault has insufficient balance.", recovery: "Deposit more funds into the vault." },
|
|
175
|
+
// ── v0.13 Hardening Errors ──
|
|
176
|
+
[SapErrorCode.PendingAmountMismatch]: { code: SapErrorCode.PendingAmountMismatch, name: "PendingAmountMismatch", message: "Pending settlement amount does not match escrow.", recovery: "This is a protocol bug — escalate immediately." },
|
|
177
|
+
[SapErrorCode.MaxCallsPerSettlementExceeded]: { code: SapErrorCode.MaxCallsPerSettlementExceeded, name: "MaxCallsPerSettlementExceeded", message: "Calls per settlement exceeds 10,000.", recovery: "Split settlement into multiple batches of ≤10,000 calls." },
|
|
178
|
+
[SapErrorCode.InvalidVolumeCurvePrice]: { code: SapErrorCode.InvalidVolumeCurvePrice, name: "InvalidVolumeCurvePrice", message: "Volume curve breakpoint price must be > 0.", recovery: "Set price_per_call > 0 for all breakpoints." },
|
|
179
|
+
[SapErrorCode.EscrowCoverageExceeded]: { code: SapErrorCode.EscrowCoverageExceeded, name: "EscrowCoverageExceeded", message: "Escrow deposit would exceed agent staked coverage.", recovery: "Increase agent stake or reduce deposit amount." },
|
|
180
|
+
[SapErrorCode.CoSignerIsAgentWallet]: { code: SapErrorCode.CoSignerIsAgentWallet, name: "CoSignerIsAgentWallet", message: "Co-signer cannot be the agent's own wallet.", recovery: "Use a different wallet for the co-signer." },
|
|
181
|
+
[SapErrorCode.PendingSettlementExists]: { code: SapErrorCode.PendingSettlementExists, name: "PendingSettlementExists", message: "Escrow has an unresolved pending settlement.", recovery: "Finalize or dispute the pending settlement before closing." },
|
|
182
|
+
[SapErrorCode.TokenAccountOwnerMismatch]: { code: SapErrorCode.TokenAccountOwnerMismatch, name: "TokenAccountOwnerMismatch", message: "SPL token account owner mismatch.", recovery: "Verify the destination token account belongs to the depositor." },
|
|
183
|
+
[SapErrorCode.MaxReceiptProofExceeded]: { code: SapErrorCode.MaxReceiptProofExceeded, name: "MaxReceiptProofExceeded", message: "Receipt proof exceeds 128 receipts.", recovery: "Submit proof in chunks of ≤128 receipts." },
|
|
184
|
+
[SapErrorCode.MaxMerkleDepthExceeded]: { code: SapErrorCode.MaxMerkleDepthExceeded, name: "MaxMerkleDepthExceeded", message: "Merkle proof depth exceeds 16.", recovery: "Verify merkle tree depth (≤16)." },
|
|
185
|
+
[SapErrorCode.StakeSlashLocksUnstake]: { code: SapErrorCode.StakeSlashLocksUnstake, name: "StakeSlashLocksUnstake", message: "Stake slash would lock unstake request.", recovery: "The unstake was reduced proportionally — retry." },
|
|
186
|
+
};
|
|
187
|
+
/** Decode an Anchor transaction error into structured info */
|
|
188
|
+
export function decodeSapError(err) {
|
|
189
|
+
// Anchor custom error format: { error: { errorCode: { code: number, number: number, ... }, ... } }
|
|
190
|
+
const anyErr = err;
|
|
191
|
+
let code;
|
|
192
|
+
// Anchor 0.30 format
|
|
193
|
+
if (anyErr.error?.errorCode?.code != null) {
|
|
194
|
+
code = anyErr.error.errorCode.code;
|
|
195
|
+
}
|
|
196
|
+
else if (anyErr.error?.errorCode?.number != null) {
|
|
197
|
+
code = anyErr.error.errorCode.number;
|
|
198
|
+
}
|
|
199
|
+
else if (anyErr.error?.instructionError?.[1]?.Custom != null) {
|
|
200
|
+
code = anyErr.error.instructionError[1].Custom;
|
|
201
|
+
}
|
|
202
|
+
if (code != null && ERROR_MAP[code]) {
|
|
203
|
+
return ERROR_MAP[code];
|
|
204
|
+
}
|
|
205
|
+
// Attempt log-based detection
|
|
206
|
+
if (anyErr.logs) {
|
|
207
|
+
for (const log of anyErr.logs) {
|
|
208
|
+
const match = log.match(/Error Code:\s*(\d+)/);
|
|
209
|
+
if (match) {
|
|
210
|
+
const logCode = parseInt(match[1], 10);
|
|
211
|
+
if (ERROR_MAP[logCode])
|
|
212
|
+
return ERROR_MAP[logCode];
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
return {
|
|
217
|
+
code: (code ?? -9999),
|
|
218
|
+
name: "UnknownError",
|
|
219
|
+
message: err?.message ?? "Unknown transaction error",
|
|
220
|
+
recovery: "Check transaction logs or retry with a different configuration.",
|
|
221
|
+
};
|
|
222
|
+
}
|
|
223
|
+
/** Is this error retryable? */
|
|
224
|
+
export function isRetryableError(err) {
|
|
225
|
+
const retryable = [
|
|
226
|
+
SapErrorCode.DisputeWindowNotExpired,
|
|
227
|
+
SapErrorCode.UnstakeTooSoon,
|
|
228
|
+
SapErrorCode.EscrowExpired, // can retry with new escrow
|
|
229
|
+
];
|
|
230
|
+
return retryable.includes(err.code);
|
|
231
|
+
}
|
|
232
|
+
/** Is this a client-side validation error that should have been caught before sending?
|
|
233
|
+
* If true, the SDK's validate functions have a bug.
|
|
234
|
+
*/
|
|
235
|
+
export function isClientValidationFailure(err) {
|
|
236
|
+
const client = [
|
|
237
|
+
SapErrorCode.AmountMustBePositive,
|
|
238
|
+
SapErrorCode.PricePerCallMustBePositive,
|
|
239
|
+
SapErrorCode.InvalidVolumeCurve,
|
|
240
|
+
SapErrorCode.VolumeCurveNotDescending,
|
|
241
|
+
SapErrorCode.TooManyVolumeCurvePoints,
|
|
242
|
+
SapErrorCode.MaxCallsPerSettlementExceeded,
|
|
243
|
+
SapErrorCode.InvalidVolumeCurvePrice,
|
|
244
|
+
SapErrorCode.EscrowAlreadyExpired,
|
|
245
|
+
SapErrorCode.CoSignerIsAgentWallet,
|
|
246
|
+
SapErrorCode.MaxReceiptProofExceeded,
|
|
247
|
+
SapErrorCode.MaxMerkleDepthExceeded,
|
|
248
|
+
SapErrorCode.SubscriptionDurationTooLong,
|
|
249
|
+
];
|
|
250
|
+
return client.includes(err.code);
|
|
251
|
+
}
|
|
252
|
+
//# sourceMappingURL=errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/errors.ts"],"names":[],"mappings":"AAAA,wBAAwB;AACxB,MAAM,OAAO,QAAS,SAAQ,KAAK;IACjC,YAAY,OAAe,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,GAAG,UAAU,CAAC,CAAC,CAAC;CACzE;AAED,oCAAoC;AACpC,MAAM,OAAO,kBAAmB,SAAQ,KAAK;IAC3C,YAAY,OAAe,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,GAAG,oBAAoB,CAAC,CAAC,CAAC;CACnF;AAED,mEAAmE;AACnE,mCAAmC;AACnC,qEAAqE;AACrE,mEAAmE;AAInE,sDAAsD;AACtD,MAAM,CAAN,IAAY,YA+GX;AA/GD,WAAY,YAAY;IACtB,cAAc;IACd,gEAAkB,CAAA;IAClB,kEAAmB,CA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AC;AAED;;GAEG;AACH,MAAM,UAAU,yBAAyB,CAAC,GAAiB;IACzD,MAAM,MAAM,GAAG;QACb,YAAY,CAAC,oBAAoB;QACjC,YAAY,CAAC,0BAA0B;QACvC,YAAY,CAAC,kBAAkB;QAC/B,YAAY,CAAC,wBAAwB;QACrC,YAAY,CAAC,wBAAwB;QACrC,YAAY,CAAC,6BAA6B;QAC1C,YAAY,CAAC,uBAAuB;QACpC,YAAY,CAAC,oBAAoB;QACjC,YAAY,CAAC,qBAAqB;QAClC,YAAY,CAAC,uBAAuB;QACpC,YAAY,CAAC,sBAAsB;QACnC,YAAY,CAAC,2BAA2B;KACzC,CAAC;IACF,OAAO,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;AACnC,CAAC"}
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module events/geyser
|
|
3
|
+
* @description Yellowstone gRPC (Geyser) event stream for SAP v2.
|
|
4
|
+
*
|
|
5
|
+
* Drop-in alternative to the WebSocket `connection.onLogs()` pipeline.
|
|
6
|
+
* Uses Triton / Helius / any Yellowstone-compatible gRPC endpoint to
|
|
7
|
+
* receive program transaction updates with sub-second latency and
|
|
8
|
+
* automatic reconnection.
|
|
9
|
+
*
|
|
10
|
+
* @category Events
|
|
11
|
+
* @since v0.6.3
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```ts
|
|
15
|
+
* import { GeyserEventStream } from "@oobe-protocol-labs/synapse-sap-sdk";
|
|
16
|
+
* import { EventParser } from "@oobe-protocol-labs/synapse-sap-sdk";
|
|
17
|
+
*
|
|
18
|
+
* const stream = new GeyserEventStream({
|
|
19
|
+
* endpoint: "https://grpc.triton.one",
|
|
20
|
+
* token: process.env.GEYSER_TOKEN!,
|
|
21
|
+
* programId: "SAPpUhsWLJG1FfkGRcXagEDMrMsWGjbky7AyhGpFETZ",
|
|
22
|
+
* });
|
|
23
|
+
*
|
|
24
|
+
* const parser = new EventParser(program);
|
|
25
|
+
*
|
|
26
|
+
* stream.on("logs", (logs, signature, slot) => {
|
|
27
|
+
* const events = parser.parseLogs(logs);
|
|
28
|
+
* for (const event of events) {
|
|
29
|
+
* console.log(event.name, event.data);
|
|
30
|
+
* }
|
|
31
|
+
* });
|
|
32
|
+
*
|
|
33
|
+
* stream.on("error", (err) => console.error("gRPC error:", err));
|
|
34
|
+
*
|
|
35
|
+
* await stream.connect();
|
|
36
|
+
* // ... later
|
|
37
|
+
* await stream.disconnect();
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
40
|
+
import { EventEmitter } from "events";
|
|
41
|
+
/**
|
|
42
|
+
* Configuration for the Yellowstone gRPC event stream.
|
|
43
|
+
*
|
|
44
|
+
* @interface GeyserConfig
|
|
45
|
+
* @since v0.6.3
|
|
46
|
+
*/
|
|
47
|
+
export interface GeyserConfig {
|
|
48
|
+
/** Yellowstone gRPC endpoint URL (e.g. "https://grpc.triton.one") */
|
|
49
|
+
endpoint: string;
|
|
50
|
+
/** Authentication token for the gRPC endpoint */
|
|
51
|
+
token: string;
|
|
52
|
+
/** SAP program ID to filter. Defaults to SAP v2 program. */
|
|
53
|
+
programId?: string;
|
|
54
|
+
/**
|
|
55
|
+
* Commitment level for the subscription.
|
|
56
|
+
* @default "confirmed"
|
|
57
|
+
*/
|
|
58
|
+
commitment?: "processed" | "confirmed" | "finalized";
|
|
59
|
+
/**
|
|
60
|
+
* Automatically reconnect on disconnect.
|
|
61
|
+
* @default true
|
|
62
|
+
*/
|
|
63
|
+
autoReconnect?: boolean;
|
|
64
|
+
/**
|
|
65
|
+
* Delay between reconnection attempts in ms.
|
|
66
|
+
* @default 3000
|
|
67
|
+
*/
|
|
68
|
+
reconnectDelayMs?: number;
|
|
69
|
+
/**
|
|
70
|
+
* Maximum number of reconnection attempts. 0 = unlimited.
|
|
71
|
+
* @default 0
|
|
72
|
+
*/
|
|
73
|
+
maxReconnectAttempts?: number;
|
|
74
|
+
/**
|
|
75
|
+
* Include failed transactions in the stream.
|
|
76
|
+
* @default false
|
|
77
|
+
*/
|
|
78
|
+
includeFailedTxs?: boolean;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Events emitted by {@link GeyserEventStream}.
|
|
82
|
+
*
|
|
83
|
+
* @interface GeyserStreamEvents
|
|
84
|
+
* @since v0.6.3
|
|
85
|
+
*/
|
|
86
|
+
export interface GeyserStreamEvents {
|
|
87
|
+
/**
|
|
88
|
+
* Emitted for each transaction's log messages.
|
|
89
|
+
* Same shape as `connection.onLogs()` callback — plug into `EventParser.parseLogs()`.
|
|
90
|
+
*/
|
|
91
|
+
logs: (logs: string[], signature: string, slot: number) => void;
|
|
92
|
+
/** Emitted when the gRPC stream connects or reconnects. */
|
|
93
|
+
connected: () => void;
|
|
94
|
+
/** Emitted when the stream disconnects. */
|
|
95
|
+
disconnected: (reason: string) => void;
|
|
96
|
+
/** Emitted on transport or parsing errors. */
|
|
97
|
+
error: (err: Error) => void;
|
|
98
|
+
/** Emitted on reconnection attempt. */
|
|
99
|
+
reconnecting: (attempt: number) => void;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Yellowstone gRPC event stream for SAP v2 programs.
|
|
103
|
+
*
|
|
104
|
+
* Wraps `@triton-one/yellowstone-grpc` and emits parsed log lines
|
|
105
|
+
* compatible with the existing {@link EventParser}.
|
|
106
|
+
*
|
|
107
|
+
* @name GeyserEventStream
|
|
108
|
+
* @category Events
|
|
109
|
+
* @since v0.6.3
|
|
110
|
+
*
|
|
111
|
+
* @example
|
|
112
|
+
* ```ts
|
|
113
|
+
* const stream = new GeyserEventStream({
|
|
114
|
+
* endpoint: "https://grpc.triton.one",
|
|
115
|
+
* token: process.env.GEYSER_TOKEN!,
|
|
116
|
+
* });
|
|
117
|
+
*
|
|
118
|
+
* stream.on("logs", (logs, sig, slot) => {
|
|
119
|
+
* const events = parser.parseLogs(logs);
|
|
120
|
+
* events.forEach(e => db.insertEvent(e));
|
|
121
|
+
* });
|
|
122
|
+
*
|
|
123
|
+
* await stream.connect();
|
|
124
|
+
* ```
|
|
125
|
+
*/
|
|
126
|
+
export declare class GeyserEventStream extends EventEmitter {
|
|
127
|
+
private readonly config;
|
|
128
|
+
private client;
|
|
129
|
+
private stream;
|
|
130
|
+
private reconnectAttempts;
|
|
131
|
+
private _connected;
|
|
132
|
+
private _stopped;
|
|
133
|
+
constructor(config: GeyserConfig);
|
|
134
|
+
/** Whether the gRPC stream is currently connected. */
|
|
135
|
+
get connected(): boolean;
|
|
136
|
+
/**
|
|
137
|
+
* Connect to the Yellowstone gRPC endpoint and start streaming.
|
|
138
|
+
*
|
|
139
|
+
* @throws If `@triton-one/yellowstone-grpc` is not installed.
|
|
140
|
+
*/
|
|
141
|
+
connect(): Promise<void>;
|
|
142
|
+
/**
|
|
143
|
+
* Disconnect from the gRPC stream and stop reconnection.
|
|
144
|
+
*/
|
|
145
|
+
disconnect(): Promise<void>;
|
|
146
|
+
private subscribe;
|
|
147
|
+
private handleMessage;
|
|
148
|
+
private maybeReconnect;
|
|
149
|
+
}
|
|
150
|
+
//# sourceMappingURL=geyser.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"geyser.d.ts","sourceRoot":"","sources":["../../../src/events/geyser.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAMtC;;;;;GAKG;AACH,MAAM,WAAW,YAAY;IAC3B,qEAAqE;IACrE,QAAQ,EAAE,MAAM,CAAC;IAEjB,iDAAiD;IACjD,KAAK,EAAE,MAAM,CAAC;IAEd,4DAA4D;IAC5D,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;OAGG;IACH,UAAU,CAAC,EAAE,WAAW,GAAG,WAAW,GAAG,WAAW,CAAC;IAErD;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB;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} from "@coral-xyz/anchor";
|
|
3
|
+
export type SapEventName = "EscrowCreated" | "SettlementFiled" | "SettlementFinalized" | "DisputeFiled" | "DisputeResolved" | "StakeEvent" | "SubscriptionEvent";
|
|
4
|
+
export interface ParsedEvent {
|
|
5
|
+
name: SapEventName;
|
|
6
|
+
data: Record<string, unknown>;
|
|
7
|
+
signature: TransactionSignature;
|
|
8
|
+
slot: number;
|
|
9
|
+
}
|
|
10
|
+
export declare class EventParser {
|
|
11
|
+
private program;
|
|
12
|
+
constructor(program: Program);
|
|
13
|
+
parseLogs(logs: string[]): ParsedEvent[];
|
|
14
|
+
}
|
|
15
|
+
export declare function parseEventsFromLogs(logs: string[], signature: TransactionSignature): ParsedEvent[];
|
|
16
|
+
export declare function fetchTransactionEvents(connection: any, signature: TransactionSignature): Promise<ParsedEvent[]>;
|
|
17
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/events/index.ts"],"names":[],"mappings":"AAKA,OAAO,EAAa,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAClE,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAE5C,MAAM,MAAM,YAAY,GACpB,eAAe,GACf,iBAAiB,GACjB,qBAAqB,GACrB,cAAc,GACd,iBAAiB,GACjB,YAAY,GACZ,mBAAmB,CAAC;AAExB,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,YAAY,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC9B,SAAS,EAAE,oBAAoB,CAAC;IAChC,IAAI,EAAE,MAAM,CAAC;CACd;AAED,qBAAa,WAAW;IACV,OAAO,CAAC,OAAO;gBAAP,OAAO,EAAE,OAAO;IAEpC,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,WAAW,EAAE;CAsBzC;AAED,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,MAAM,EAAE,EACd,SAAS,EAAE,oBAAoB,GAC9B,WAAW,EAAE,CAGf;AAED,wBAAsB,sBAAsB,CAC1C,UAAU,EAAE,GAAG,EACf,SAAS,EAAE,oBAAoB,GAC9B,OAAO,CAAC,WAAW,EAAE,CAAC,CAIxB"}
|