@glamsystems/glam-cli 1.0.14-alpha.1 → 1.0.14-alpha.2
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/main.js +108 -33
- package/package.json +2 -2
package/main.js
CHANGED
|
@@ -271,7 +271,7 @@ module.exports = /*#__PURE__*/JSON.parse('{"address":"G1NTcMDYgNLpDwgnrpSZvoSKQu
|
|
|
271
271
|
/***/ ((module) => {
|
|
272
272
|
|
|
273
273
|
"use strict";
|
|
274
|
-
module.exports = /*#__PURE__*/JSON.parse('{"address":"G1NTbnLcjMex9Tjo8ocmNK9S2zBCiGVuxKUUNGhYZztx","metadata":{"name":"ext_bridge","version":"1.0.0","spec":"0.1.0","description":"Bridge integration for GLAM Protocol"},"instructions":[{"name":"add_layerzero_oft_route","discriminator":[53,181,204,38,240,57,218,148],"accounts":[{"name":"glam_state","writable":true},{"name":"glam_signer","writable":true,"signer":true},{"name":"glam_protocol_program","address":"GLAMpaME8wdTEzxtiYEAa5yD8fZbxZiz2hNtV58RZiEz"}],"args":[{"name":"route","type":{"defined":{"name":"LayerzeroOftRoute"}}}]},{"name":"cleanup_transfer_record","docs":["Closes a finalized transfer record and returns its rent."],"discriminator":[65,224,219,143,99,204,215,6],"accounts":[{"name":"glam_state"},{"name":"glam_signer","writable":true,"signer":true},{"name":"transfer_record","writable":true}],"args":[]},{"name":"commit_oft_transfer","docs":["Verifies the OFT send completed and records the resulting transfer."],"discriminator":[246,116,17,13,64,227,248,78],"accounts":[{"name":"glam_state","writable":true},{"name":"glam_vault","pda":{"seeds":[{"kind":"const","value":[118,97,117,108,116]},{"kind":"account","path":"glam_state"}],"program":{"kind":"account","path":"glam_protocol_program"}}},{"name":"glam_signer","writable":true,"signer":true},{"name":"integration_authority","pda":{"seeds":[{"kind":"const","value":[105,110,116,101,103,114,97,116,105,111,110,45,97,117,116,104,111,114,105,116,121]}]}},{"name":"cpi_program"},{"name":"glam_protocol_program","address":"GLAMpaME8wdTEzxtiYEAa5yD8fZbxZiz2hNtV58RZiEz"},{"name":"system_program","address":"11111111111111111111111111111111"},{"name":"instructions","address":"Sysvar1nstructions1111111111111111111111111"},{"name":"bridge_registry","writable":true,"pda":{"seeds":[{"kind":"const","value":[98,114,105,100,103,101,45,114,101,103,105,115,116,114,121]},{"kind":"account","path":"glam_state"}]}},{"name":"bridge_session","writable":true,"pda":{"seeds":[{"kind":"const","value":[98,114,105,100,103,101,45,115,101,115,115,105,111,110]},{"kind":"account","path":"glam_state"},{"kind":"arg","path":"args.transfer_id"}]}},{"name":"transfer_record","writable":true,"pda":{"seeds":[{"kind":"const","value":[98,114,105,100,103,101,45,116,114,97,110,115,102,101,114,45,114,101,99,111,114,100]},{"kind":"account","path":"glam_state"},{"kind":"arg","path":"args.transfer_id"}]}},{"name":"source_token_account","writable":true},{"name":"source_mint"},{"name":"auxiliary_token_account","writable":true}],"args":[{"name":"args","type":{"defined":{"name":"CommitOftTransferArgs"}}}]},{"name":"delete_layerzero_oft_route","discriminator":[122,191,90,182,160,67,86,227],"accounts":[{"name":"glam_state","writable":true},{"name":"glam_signer","writable":true,"signer":true},{"name":"glam_protocol_program","address":"GLAMpaME8wdTEzxtiYEAa5yD8fZbxZiz2hNtV58RZiEz"}],"args":[{"name":"route","type":{"defined":{"name":"LayerzeroOftRoute"}}}]},{"name":"fail_or_cancel_managed_transfer","docs":["Marks a managed inflight transfer as failed or cancelled."],"discriminator":[39,37,213,118,191,18,194,119],"accounts":[{"name":"glam_state","writable":true},{"name":"glam_vault","pda":{"seeds":[{"kind":"const","value":[118,97,117,108,116]},{"kind":"account","path":"glam_state"}],"program":{"kind":"account","path":"glam_protocol_program"}}},{"name":"glam_signer","signer":true},{"name":"integration_authority","pda":{"seeds":[{"kind":"const","value":[105,110,116,101,103,114,97,116,105,111,110,45,97,117,116,104,111,114,105,116,121]}]}},{"name":"glam_protocol_program","address":"GLAMpaME8wdTEzxtiYEAa5yD8fZbxZiz2hNtV58RZiEz"},{"name":"system_program","address":"11111111111111111111111111111111"},{"name":"bridge_registry","writable":true,"pda":{"seeds":[{"kind":"const","value":[98,114,105,100,103,101,45,114,101,103,105,115,116,114,121]},{"kind":"account","path":"glam_state"}]}},{"name":"transfer_record","writable":true}],"args":[{"name":"failure_reason","type":"u8"}]},{"name":"prepare_oft_transfer","docs":["Prepares the auxiliary token account used by the OFT transfer flow."],"discriminator":[192,75,97,92,178,246,220,8],"accounts":[{"name":"glam_state","writable":true},{"name":"glam_vault","writable":true,"pda":{"seeds":[{"kind":"const","value":[118,97,117,108,116]},{"kind":"account","path":"glam_state"}],"program":{"kind":"account","path":"glam_protocol_program"}}},{"name":"glam_signer","writable":true,"signer":true},{"name":"integration_authority","pda":{"seeds":[{"kind":"const","value":[105,110,116,101,103,114,97,116,105,111,110,45,97,117,116,104,111,114,105,116,121]}]}},{"name":"bridge_registry","writable":true,"pda":{"seeds":[{"kind":"const","value":[98,114,105,100,103,101,45,114,101,103,105,115,116,114,121]},{"kind":"account","path":"glam_state"}]}},{"name":"bridge_session","writable":true,"pda":{"seeds":[{"kind":"const","value":[98,114,105,100,103,101,45,115,101,115,115,105,111,110]},{"kind":"account","path":"glam_state"},{"kind":"arg","path":"args.transfer_id"}]}},{"name":"source_token_account","writable":true},{"name":"source_mint"},{"name":"auxiliary_token_account","writable":true},{"name":"cpi_program"},{"name":"glam_protocol_program","address":"GLAMpaME8wdTEzxtiYEAa5yD8fZbxZiz2hNtV58RZiEz"},{"name":"system_program","address":"11111111111111111111111111111111"},{"name":"instructions","address":"Sysvar1nstructions1111111111111111111111111"}],"args":[{"name":"args","type":{"defined":{"name":"PrepareOftTransferArgs"}}}]},{"name":"reconcile_managed_transfer","docs":["Reconciles a managed inflight transfer back into normal pricing state."],"discriminator":[137,31,188,80,28,252,192,50],"accounts":[{"name":"glam_state","writable":true},{"name":"glam_vault","writable":true,"pda":{"seeds":[{"kind":"const","value":[118,97,117,108,116]},{"kind":"account","path":"glam_state"}],"program":{"kind":"account","path":"glam_protocol_program"}}},{"name":"glam_signer","signer":true},{"name":"integration_authority","pda":{"seeds":[{"kind":"const","value":[105,110,116,101,103,114,97,116,105,111,110,45,97,117,116,104,111,114,105,116,121]}]}},{"name":"glam_protocol_program","address":"GLAMpaME8wdTEzxtiYEAa5yD8fZbxZiz2hNtV58RZiEz"},{"name":"system_program","address":"11111111111111111111111111111111"},{"name":"bridge_registry","writable":true,"pda":{"seeds":[{"kind":"const","value":[98,114,105,100,103,101,45,114,101,103,105,115,116,114,121]},{"kind":"account","path":"glam_state"}]}},{"name":"transfer_record","writable":true}],"args":[]},{"name":"settle_managed_transfer","docs":["Marks a managed inflight transfer as settled on the destination side."],"discriminator":[197,87,37,239,24,244,152,135],"accounts":[{"name":"glam_state"},{"name":"glam_signer","signer":true},{"name":"transfer_record","writable":true}],"args":[]},{"name":"update_layerzero_oft_route","discriminator":[77,162,99,1,182,142,66,172],"accounts":[{"name":"glam_state","writable":true},{"name":"glam_signer","writable":true,"signer":true},{"name":"glam_protocol_program","address":"GLAMpaME8wdTEzxtiYEAa5yD8fZbxZiz2hNtV58RZiEz"}],"args":[{"name":"route","type":{"defined":{"name":"LayerzeroOftRoute"}}}]}],"accounts":[{"name":"BridgeRegistry","discriminator":[178,207,65,53,51,157,148,202]},{"name":"BridgeSession","discriminator":[235,118,90,227,230,173,141,184]},{"name":"BridgeTransferRecord","discriminator":[46,131,253,32,218,137,45,96]},{"name":"StateAccount","discriminator":[142,247,54,95,85,133,249,103]}],"errors":[{"code":6000,"name":"UnsupportedProtocol","msg":"Unsupported bridge protocol"},{"code":6001,"name":"PolicyNotFound","msg":"A matching bridge policy was not found"},{"code":6002,"name":"AmountTooSmall","msg":"Bridge amount is below the policy minimum"},{"code":6003,"name":"AmountTooLarge","msg":"Bridge amount exceeds the policy maximum"},{"code":6004,"name":"InvalidProviderProgram","msg":"The provider program does not match the approved policy"},{"code":6005,"name":"InvalidSourceTokenAccount","msg":"The source token account is invalid"},{"code":6006,"name":"InvalidSourceBalance","msg":"The source token balance did not change as expected"},{"code":6007,"name":"InvalidProviderReceipt","msg":"The bridge receipt metadata is invalid"},{"code":6008,"name":"InvalidTransferStatus","msg":"The bridge transfer status does not allow this action"},{"code":6009,"name":"TransferNotManaged","msg":"Only managed transfers can use this instruction"},{"code":6010,"name":"MathOverflow","msg":"Arithmetic overflow"},{"code":6011,"name":"InvalidTransferRecord","msg":"The transfer record does not belong to this vault"},{"code":6012,"name":"TooManyProviderInstructions","msg":"Too many provider instructions were supplied"},{"code":6013,"name":"DuplicateBridgeRoute","msg":"Bridge policy contains overlapping duplicate routes"},{"code":6014,"name":"BridgeRouteNotFound","msg":"The bridge route was not found in the existing policy"},{"code":6015,"name":"AmbiguousBridgeRoute","msg":"Multiple bridge routes matched; disambiguate the provider identity"},{"code":6016,"name":"InvalidOftAuxiliaryTokenAccount","msg":"The OFT auxiliary token account is invalid"},{"code":6017,"name":"OftAuxiliaryTokenAccountAlreadyExists","msg":"The OFT auxiliary token account already exists"},{"code":6018,"name":"MissingEndOftInstruction","msg":"Transaction must include a matching commit_oft_transfer instruction"},{"code":6019,"name":"InvalidOftInstructionSet","msg":"The OFT middle instruction set is invalid"},{"code":6020,"name":"InvalidOftAuxiliaryBalance","msg":"The OFT auxiliary token balance did not change as expected"}],"types":[{"name":"AccountType","type":{"kind":"enum","variants":[{"name":"Vault"},{"name":"TokenizedVault"},{"name":"Mint"},{"name":"SingleAssetVault"}]}},{"name":"AccruedFees","type":{"kind":"struct","fields":[{"name":"vault_subscription_fee","type":"u128"},{"name":"vault_redemption_fee","type":"u128"},{"name":"manager_subscription_fee","type":"u128"},{"name":"manager_redemption_fee","type":"u128"},{"name":"management_fee","type":"u128"},{"name":"performance_fee","type":"u128"},{"name":"protocol_base_fee","type":"u128"},{"name":"protocol_flow_fee","type":"u128"}]}},{"name":"BridgeRegistry","type":{"kind":"struct","fields":[{"name":"glam_state","type":"pubkey"},{"name":"managed_transfer_count","type":"u64"},{"name":"bump","type":"u8"}]}},{"name":"BridgeSession","type":{"kind":"struct","fields":[{"name":"glam_state","type":"pubkey"},{"name":"signer","type":"pubkey"},{"name":"transfer_id","type":{"array":["u8",32]}},{"name":"protocol","type":"u16"},{"name":"managed","type":"bool"},{"name":"source_mint","type":"pubkey"},{"name":"source_token_account","type":"pubkey"},{"name":"provider_program","type":"pubkey"},{"name":"provider_config","type":"pubkey"},{"name":"provider_sender","type":"pubkey"},{"name":"provider_delegate","type":"pubkey"},{"name":"provider_receipt","type":"pubkey"},{"name":"provider_instruction_hash","type":{"array":["u8",32]}},{"name":"provider_instruction_count","type":"u16"},{"name":"source_amount","type":"u64"},{"name":"quoted_out_amount","type":"u64"},{"name":"initial_source_balance","type":"u64"},{"name":"initial_provider_sequence","type":"u64"},{"name":"destination_chain","type":"u16"},{"name":"destination_recipient","type":"pubkey"},{"name":"quote_expires_at","type":"i64"},{"name":"prepared_slot","type":"u64"},{"name":"bump","type":"u8"}]}},{"name":"BridgeTransferRecord","type":{"kind":"struct","fields":[{"name":"glam_state","type":"pubkey"},{"name":"transfer_id","type":{"array":["u8",32]}},{"name":"protocol","type":"u16"},{"name":"status","type":{"defined":{"name":"BridgeTransferStatus"}}},{"name":"managed","type":"bool"},{"name":"receipt_verified","type":"bool"},{"name":"source_mint","type":"pubkey"},{"name":"source_token_account","type":"pubkey"},{"name":"provider_program","type":"pubkey"},{"name":"provider_config","type":"pubkey"},{"name":"source_amount","type":"u64"},{"name":"quoted_out_amount","type":"u64"},{"name":"destination_chain","type":"u16"},{"name":"destination_recipient","type":"pubkey"},{"name":"provider_transfer_id","type":{"array":["u8",32]}},{"name":"provider_emitter","type":"pubkey"},{"name":"provider_sequence","type":"u64"},{"name":"committed_slot","type":"u64"},{"name":"settled_slot","type":"u64"},{"name":"reconciled_slot","type":"u64"},{"name":"failure_reason","type":"u8"},{"name":"bump","type":"u8"}]}},{"name":"BridgeTransferStatus","type":{"kind":"enum","variants":[{"name":"Committed"},{"name":"Settled"},{"name":"Reconciled"},{"name":"Failed"}]}},{"name":"CommitOftTransferArgs","type":{"kind":"struct","fields":[{"name":"transfer_id","type":{"array":["u8",32]}}]}},{"name":"CreatedModel","type":{"kind":"struct","fields":[{"name":"key","type":{"array":["u8",8]}},{"name":"created_by","type":"pubkey"},{"name":"created_at","type":"i64"}]}},{"name":"DelegateAcl","type":{"kind":"struct","fields":[{"name":"pubkey","type":"pubkey"},{"name":"integration_permissions","type":{"vec":{"defined":{"name":"IntegrationPermissions"}}}},{"name":"expires_at","type":"i64"}]}},{"name":"EngineField","type":{"kind":"struct","fields":[{"name":"name","type":{"defined":{"name":"EngineFieldName"}}},{"name":"value","type":{"defined":{"name":"EngineFieldValue"}}}]}},{"name":"EngineFieldName","type":{"kind":"enum","variants":[{"name":"Owner"},{"name":"PortfolioManagerName"},{"name":"Name"},{"name":"Uri"},{"name":"Assets"},{"name":"DelegateAcls"},{"name":"IntegrationAcls"},{"name":"TimelockDuration"},{"name":"Borrowable"},{"name":"DefaultAccountStateFrozen"},{"name":"PermanentDelegate"},{"name":"NotifyAndSettle"},{"name":"FeeStructure"},{"name":"FeeParams"},{"name":"ClaimableFees"},{"name":"ClaimedFees"},{"name":"OracleConfigs"}]}},{"name":"EngineFieldValue","type":{"kind":"enum","variants":[{"name":"Boolean","fields":[{"name":"val","type":"bool"}]},{"name":"U8","fields":[{"name":"val","type":"u8"}]},{"name":"U32","fields":[{"name":"val","type":"u32"}]},{"name":"U64","fields":[{"name":"val","type":"u64"}]},{"name":"String","fields":[{"name":"val","type":"string"}]},{"name":"Pubkey","fields":[{"name":"val","type":"pubkey"}]},{"name":"VecPubkey","fields":[{"name":"val","type":{"vec":"pubkey"}}]},{"name":"VecU8","fields":[{"name":"val","type":"bytes"}]},{"name":"VecU32","fields":[{"name":"val","type":{"vec":"u32"}}]},{"name":"VecDelegateAcl","fields":[{"name":"val","type":{"vec":{"defined":{"name":"DelegateAcl"}}}}]},{"name":"VecIntegrationAcl","fields":[{"name":"val","type":{"vec":{"defined":{"name":"IntegrationAcl"}}}}]},{"name":"FeeStructure","fields":[{"name":"val","type":{"defined":{"name":"FeeStructure"}}}]},{"name":"FeeParams","fields":[{"name":"val","type":{"defined":{"name":"FeeParams"}}}]},{"name":"AccruedFees","fields":[{"name":"val","type":{"defined":{"name":"AccruedFees"}}}]},{"name":"NotifyAndSettle","fields":[{"name":"val","type":{"defined":{"name":"NotifyAndSettle"}}}]},{"name":"OracleConfigs","fields":[{"name":"val","type":{"defined":{"name":"OracleConfigs"}}}]}]}},{"name":"EntryExitFees","type":{"kind":"struct","fields":[{"name":"subscription_fee_bps","type":"u16"},{"name":"redemption_fee_bps","type":"u16"}]}},{"name":"FeeParams","type":{"kind":"struct","fields":[{"name":"year_in_seconds","type":"u32"},{"name":"pa_high_water_mark","type":"i128"},{"name":"pa_last_nav","type":"i128"},{"name":"last_aum","type":"i128"},{"name":"last_performance_fee_crystallized","type":"i64"},{"name":"last_management_fee_crystallized","type":"i64"},{"name":"last_protocol_fee_crystallized","type":"i64"}]}},{"name":"FeeStructure","type":{"kind":"struct","fields":[{"name":"vault","type":{"defined":{"name":"EntryExitFees"}}},{"name":"manager","type":{"defined":{"name":"EntryExitFees"}}},{"name":"management","type":{"defined":{"name":"ManagementFee"}}},{"name":"performance","type":{"defined":{"name":"PerformanceFee"}}},{"name":"protocol","type":{"defined":{"name":"ProtocolFees"}}}]}},{"name":"HurdleType","type":{"kind":"enum","variants":[{"name":"Hard"},{"name":"Soft"}]}},{"name":"IntegrationAcl","docs":["An integration program can have multiple protocols supported.","Enabled protocols are stored in a bitmask, and each protocol can have its own policy."],"type":{"kind":"struct","fields":[{"name":"integration_program","type":"pubkey"},{"name":"protocols_bitmask","type":"u16"},{"name":"protocol_policies","type":{"vec":{"defined":{"name":"ProtocolPolicy"}}}}]}},{"name":"IntegrationPermissions","docs":["Stores delegate permissions for an integration program."],"type":{"kind":"struct","fields":[{"name":"integration_program","type":"pubkey"},{"name":"protocol_permissions","type":{"vec":{"defined":{"name":"ProtocolPermissions"}}}}]}},{"name":"LayerzeroOftRoute","docs":["source_mint, destination_chain, destination_recipient, provider_program uniquely identify a route"],"type":{"kind":"struct","fields":[{"name":"source_mint","type":"pubkey"},{"name":"destination_chain","type":"u32"},{"name":"destination_recipient","type":"pubkey"},{"name":"provider_program","type":"pubkey"},{"name":"management_mode","type":{"defined":{"name":"RouteManagementMode"}}},{"name":"min_amount","type":"u64"},{"name":"max_amount","type":"u64"}]}},{"name":"ManagementFee","type":{"kind":"struct","fields":[{"name":"fee_bps","type":"u16"}]}},{"name":"NoticePeriodType","type":{"kind":"enum","variants":[{"name":"Hard"},{"name":"Soft"}]}},{"name":"NotifyAndSettle","type":{"kind":"struct","fields":[{"name":"model","type":{"defined":{"name":"ValuationModel"}}},{"name":"permissionless_fulfillment","type":"bool"},{"name":"subscribe_notice_period_type","type":{"defined":{"name":"NoticePeriodType"}}},{"name":"subscribe_notice_period","type":"u64"},{"name":"subscribe_settlement_period","type":"u64"},{"name":"subscribe_cancellation_window","type":"u64"},{"name":"redeem_notice_period_type","type":{"defined":{"name":"NoticePeriodType"}}},{"name":"redeem_notice_period","type":"u64"},{"name":"redeem_settlement_period","type":"u64"},{"name":"redeem_cancellation_window","type":"u64"},{"name":"time_unit","type":{"defined":{"name":"TimeUnit"}}},{"name":"_padding","type":{"array":["u8",3]}}]}},{"name":"OracleConfigs","docs":["Vault-specific oracle configs. If available, these configs are preferred over the global config."],"type":{"kind":"struct","fields":[{"name":"max_ages_seconds","type":{"vec":{"array":["u16",2]}}},{"name":"padding","type":{"array":["u8",12]}}]}},{"name":"PerformanceFee","type":{"kind":"struct","fields":[{"name":"fee_bps","type":"u16"},{"name":"hurdle_rate_bps","type":"u16"},{"name":"hurdle_type","type":{"defined":{"name":"HurdleType"}}}]}},{"name":"PrepareOftTransferArgs","type":{"kind":"struct","fields":[{"name":"transfer_id","type":{"array":["u8",32]}},{"name":"middle_instruction_hash","type":{"array":["u8",32]}},{"name":"middle_instruction_count","type":"u16"},{"name":"source_amount","type":"u64"},{"name":"managed","type":"bool"}]}},{"name":"PricedProtocol","type":{"kind":"struct","fields":[{"name":"rent","type":"u64"},{"name":"amount","type":"i128"},{"name":"decimals","type":"u8"},{"name":"last_updated_slot","type":"u64"},{"name":"integration_program","type":"pubkey"},{"name":"protocol_bitflag","type":"u16"},{"name":"positions","type":{"vec":"pubkey"}}]}},{"name":"ProtocolFees","type":{"kind":"struct","fields":[{"name":"base_fee_bps","type":"u16"},{"name":"flow_fee_bps","type":"u16"}]}},{"name":"ProtocolPermissions","docs":["Represents a delegate\'s permissions for a specific protocol"],"type":{"kind":"struct","fields":[{"name":"protocol_bitflag","type":"u16"},{"name":"permissions_bitmask","type":"u64"}]}},{"name":"ProtocolPolicy","docs":["Stores policy data for an integrated protocol.","Integration programs serialize/deserialize this data."],"type":{"kind":"struct","fields":[{"name":"protocol_bitflag","type":"u16"},{"name":"data","type":"bytes"}]}},{"name":"RouteManagementMode","type":{"kind":"enum","variants":[{"name":"UnmanagedOnly"},{"name":"ManagedOnly"},{"name":"Either"}]}},{"name":"StateAccount","type":{"kind":"struct","fields":[{"name":"account_type","type":{"defined":{"name":"AccountType"}}},{"name":"enabled","type":"bool"},{"name":"vault","type":"pubkey"},{"name":"owner","type":"pubkey"},{"name":"portfolio_manager_name","type":{"array":["u8",32]}},{"name":"created","type":{"defined":{"name":"CreatedModel"}}},{"name":"base_asset_mint","type":"pubkey"},{"name":"base_asset_decimals","type":"u8"},{"name":"base_asset_token_program","type":"u8"},{"name":"name","type":{"array":["u8",32]}},{"name":"timelock_duration","type":"u32"},{"name":"timelock_expires_at","type":"u64"},{"name":"mint","type":"pubkey"},{"name":"assets","type":{"vec":"pubkey"}},{"name":"integration_acls","type":{"vec":{"defined":{"name":"IntegrationAcl"}}}},{"name":"delegate_acls","type":{"vec":{"defined":{"name":"DelegateAcl"}}}},{"name":"external_positions","type":{"vec":"pubkey"}},{"name":"priced_protocols","type":{"vec":{"defined":{"name":"PricedProtocol"}}}},{"name":"params","type":{"vec":{"vec":{"defined":{"name":"EngineField"}}}}}]}},{"name":"TimeUnit","type":{"kind":"enum","variants":[{"name":"Second"},{"name":"Slot"}]}},{"name":"ValuationModel","type":{"kind":"enum","variants":[{"name":"Continuous"},{"name":"Periodic"}]}}],"constants":[{"name":"PROTO_BRIDGE_PERM_RECONCILE","type":"u64","value":"2"},{"name":"PROTO_BRIDGE_PERM_SEND","type":"u64","value":"1"},{"name":"PROTO_LAYERZERO_OFT","type":"u16","value":"4"},{"name":"PROTO_MANAGED_INFLIGHT","type":"u16","value":"4"}]}');
|
|
274
|
+
module.exports = /*#__PURE__*/JSON.parse('{"address":"G1NTbnLcjMex9Tjo8ocmNK9S2zBCiGVuxKUUNGhYZztx","metadata":{"name":"ext_bridge","version":"1.0.0","spec":"0.1.0","description":"Bridge integration for GLAM Protocol"},"instructions":[{"name":"add_layerzero_oft_route","discriminator":[53,181,204,38,240,57,218,148],"accounts":[{"name":"glam_state","writable":true},{"name":"glam_signer","writable":true,"signer":true},{"name":"glam_protocol_program","address":"GLAMpaME8wdTEzxtiYEAa5yD8fZbxZiz2hNtV58RZiEz"}],"args":[{"name":"route","type":{"defined":{"name":"LayerzeroOftRoute"}}}]},{"name":"cleanup_transfer_record","docs":["Closes a finalized transfer record and returns its rent."],"discriminator":[65,224,219,143,99,204,215,6],"accounts":[{"name":"glam_state"},{"name":"glam_signer","writable":true,"signer":true},{"name":"transfer_record","writable":true}],"args":[]},{"name":"commit_oft_transfer","docs":["Verifies the OFT send completed and records the resulting transfer."],"discriminator":[246,116,17,13,64,227,248,78],"accounts":[{"name":"glam_state","writable":true},{"name":"glam_vault","writable":true,"pda":{"seeds":[{"kind":"const","value":[118,97,117,108,116]},{"kind":"account","path":"glam_state"}],"program":{"kind":"account","path":"glam_protocol_program"}}},{"name":"glam_signer","writable":true,"signer":true},{"name":"integration_authority","pda":{"seeds":[{"kind":"const","value":[105,110,116,101,103,114,97,116,105,111,110,45,97,117,116,104,111,114,105,116,121]}]}},{"name":"cpi_program"},{"name":"glam_protocol_program","address":"GLAMpaME8wdTEzxtiYEAa5yD8fZbxZiz2hNtV58RZiEz"},{"name":"system_program","address":"11111111111111111111111111111111"},{"name":"instructions","address":"Sysvar1nstructions1111111111111111111111111"},{"name":"bridge_registry","writable":true,"pda":{"seeds":[{"kind":"const","value":[98,114,105,100,103,101,45,114,101,103,105,115,116,114,121]},{"kind":"account","path":"glam_state"}]}},{"name":"bridge_session","writable":true,"pda":{"seeds":[{"kind":"const","value":[98,114,105,100,103,101,45,115,101,115,115,105,111,110]},{"kind":"account","path":"glam_state"},{"kind":"arg","path":"args.transfer_id"}]}},{"name":"transfer_record","writable":true,"pda":{"seeds":[{"kind":"const","value":[98,114,105,100,103,101,45,116,114,97,110,115,102,101,114,45,114,101,99,111,114,100]},{"kind":"account","path":"glam_state"},{"kind":"arg","path":"args.transfer_id"}]}},{"name":"source_token_account","writable":true},{"name":"source_mint"},{"name":"auxiliary_token_account","writable":true}],"args":[{"name":"args","type":{"defined":{"name":"CommitOftTransferArgs"}}}]},{"name":"delete_layerzero_oft_route","discriminator":[122,191,90,182,160,67,86,227],"accounts":[{"name":"glam_state","writable":true},{"name":"glam_signer","writable":true,"signer":true},{"name":"glam_protocol_program","address":"GLAMpaME8wdTEzxtiYEAa5yD8fZbxZiz2hNtV58RZiEz"}],"args":[{"name":"route","type":{"defined":{"name":"LayerzeroOftRoute"}}}]},{"name":"fail_or_cancel_managed_transfer","docs":["Marks a managed inflight transfer as failed or cancelled."],"discriminator":[39,37,213,118,191,18,194,119],"accounts":[{"name":"glam_state","writable":true},{"name":"glam_vault","writable":true,"pda":{"seeds":[{"kind":"const","value":[118,97,117,108,116]},{"kind":"account","path":"glam_state"}],"program":{"kind":"account","path":"glam_protocol_program"}}},{"name":"glam_signer","signer":true},{"name":"integration_authority","pda":{"seeds":[{"kind":"const","value":[105,110,116,101,103,114,97,116,105,111,110,45,97,117,116,104,111,114,105,116,121]}]}},{"name":"glam_protocol_program","address":"GLAMpaME8wdTEzxtiYEAa5yD8fZbxZiz2hNtV58RZiEz"},{"name":"system_program","address":"11111111111111111111111111111111"},{"name":"bridge_registry","writable":true,"pda":{"seeds":[{"kind":"const","value":[98,114,105,100,103,101,45,114,101,103,105,115,116,114,121]},{"kind":"account","path":"glam_state"}]}},{"name":"transfer_record","writable":true}],"args":[{"name":"failure_reason","type":"u8"}]},{"name":"prepare_oft_transfer","docs":["Prepares the auxiliary token account used by the OFT transfer flow."],"discriminator":[192,75,97,92,178,246,220,8],"accounts":[{"name":"glam_state","writable":true},{"name":"glam_vault","writable":true,"pda":{"seeds":[{"kind":"const","value":[118,97,117,108,116]},{"kind":"account","path":"glam_state"}],"program":{"kind":"account","path":"glam_protocol_program"}}},{"name":"glam_signer","writable":true,"signer":true},{"name":"integration_authority","pda":{"seeds":[{"kind":"const","value":[105,110,116,101,103,114,97,116,105,111,110,45,97,117,116,104,111,114,105,116,121]}]}},{"name":"bridge_registry","writable":true,"pda":{"seeds":[{"kind":"const","value":[98,114,105,100,103,101,45,114,101,103,105,115,116,114,121]},{"kind":"account","path":"glam_state"}]}},{"name":"bridge_session","writable":true,"pda":{"seeds":[{"kind":"const","value":[98,114,105,100,103,101,45,115,101,115,115,105,111,110]},{"kind":"account","path":"glam_state"},{"kind":"arg","path":"args.transfer_id"}]}},{"name":"source_token_account","writable":true},{"name":"source_mint"},{"name":"auxiliary_token_account","writable":true},{"name":"cpi_program"},{"name":"glam_protocol_program","address":"GLAMpaME8wdTEzxtiYEAa5yD8fZbxZiz2hNtV58RZiEz"},{"name":"system_program","address":"11111111111111111111111111111111"},{"name":"instructions","address":"Sysvar1nstructions1111111111111111111111111"}],"args":[{"name":"args","type":{"defined":{"name":"PrepareOftTransferArgs"}}}]},{"name":"reconcile_managed_transfer","docs":["Reconciles a managed inflight transfer back into normal pricing state."],"discriminator":[137,31,188,80,28,252,192,50],"accounts":[{"name":"glam_state","writable":true},{"name":"glam_vault","writable":true,"pda":{"seeds":[{"kind":"const","value":[118,97,117,108,116]},{"kind":"account","path":"glam_state"}],"program":{"kind":"account","path":"glam_protocol_program"}}},{"name":"glam_signer","signer":true},{"name":"integration_authority","pda":{"seeds":[{"kind":"const","value":[105,110,116,101,103,114,97,116,105,111,110,45,97,117,116,104,111,114,105,116,121]}]}},{"name":"glam_protocol_program","address":"GLAMpaME8wdTEzxtiYEAa5yD8fZbxZiz2hNtV58RZiEz"},{"name":"system_program","address":"11111111111111111111111111111111"},{"name":"bridge_registry","writable":true,"pda":{"seeds":[{"kind":"const","value":[98,114,105,100,103,101,45,114,101,103,105,115,116,114,121]},{"kind":"account","path":"glam_state"}]}},{"name":"transfer_record","writable":true}],"args":[]},{"name":"settle_managed_transfer","docs":["Marks a managed inflight transfer as settled on the destination side."],"discriminator":[197,87,37,239,24,244,152,135],"accounts":[{"name":"glam_state"},{"name":"glam_signer","signer":true},{"name":"transfer_record","writable":true}],"args":[]},{"name":"update_layerzero_oft_route","discriminator":[77,162,99,1,182,142,66,172],"accounts":[{"name":"glam_state","writable":true},{"name":"glam_signer","writable":true,"signer":true},{"name":"glam_protocol_program","address":"GLAMpaME8wdTEzxtiYEAa5yD8fZbxZiz2hNtV58RZiEz"}],"args":[{"name":"route","type":{"defined":{"name":"LayerzeroOftRoute"}}}]}],"accounts":[{"name":"BridgeRegistry","discriminator":[178,207,65,53,51,157,148,202]},{"name":"BridgeSession","discriminator":[235,118,90,227,230,173,141,184]},{"name":"BridgeTransferRecord","discriminator":[46,131,253,32,218,137,45,96]},{"name":"StateAccount","discriminator":[142,247,54,95,85,133,249,103]}],"errors":[{"code":6000,"name":"UnsupportedProtocol","msg":"Unsupported bridge protocol"},{"code":6001,"name":"PolicyNotFound","msg":"A matching bridge policy was not found"},{"code":6002,"name":"AmountTooSmall","msg":"Bridge amount is below the policy minimum"},{"code":6003,"name":"AmountTooLarge","msg":"Bridge amount exceeds the policy maximum"},{"code":6004,"name":"InvalidProviderProgram","msg":"The provider program does not match the approved policy"},{"code":6005,"name":"InvalidSourceTokenAccount","msg":"The source token account is invalid"},{"code":6006,"name":"InvalidSourceBalance","msg":"The source token balance did not change as expected"},{"code":6007,"name":"InvalidProviderReceipt","msg":"The bridge receipt metadata is invalid"},{"code":6008,"name":"InvalidTransferStatus","msg":"The bridge transfer status does not allow this action"},{"code":6009,"name":"TransferNotManaged","msg":"Only managed transfers can use this instruction"},{"code":6010,"name":"MathOverflow","msg":"Arithmetic overflow"},{"code":6011,"name":"InvalidTransferRecord","msg":"The transfer record does not belong to this vault"},{"code":6012,"name":"TooManyProviderInstructions","msg":"Too many provider instructions were supplied"},{"code":6013,"name":"DuplicateBridgeRoute","msg":"Bridge policy contains overlapping duplicate routes"},{"code":6014,"name":"BridgeRouteNotFound","msg":"The bridge route was not found in the existing policy"},{"code":6015,"name":"AmbiguousBridgeRoute","msg":"Multiple bridge routes matched; disambiguate the provider identity"},{"code":6016,"name":"InvalidOftAuxiliaryTokenAccount","msg":"The OFT auxiliary token account is invalid"},{"code":6017,"name":"OftAuxiliaryTokenAccountAlreadyExists","msg":"The OFT auxiliary token account already exists"},{"code":6018,"name":"MissingEndOftInstruction","msg":"Transaction must include a matching commit_oft_transfer instruction"},{"code":6019,"name":"InvalidOftInstructionSet","msg":"The OFT middle instruction set is invalid"},{"code":6020,"name":"InvalidOftAuxiliaryBalance","msg":"The OFT auxiliary token balance did not change as expected"}],"types":[{"name":"AccountType","type":{"kind":"enum","variants":[{"name":"Vault"},{"name":"TokenizedVault"},{"name":"Mint"},{"name":"SingleAssetVault"}]}},{"name":"AccruedFees","type":{"kind":"struct","fields":[{"name":"vault_subscription_fee","type":"u128"},{"name":"vault_redemption_fee","type":"u128"},{"name":"manager_subscription_fee","type":"u128"},{"name":"manager_redemption_fee","type":"u128"},{"name":"management_fee","type":"u128"},{"name":"performance_fee","type":"u128"},{"name":"protocol_base_fee","type":"u128"},{"name":"protocol_flow_fee","type":"u128"}]}},{"name":"BridgeRegistry","type":{"kind":"struct","fields":[{"name":"glam_state","type":"pubkey"},{"name":"managed_transfer_count","type":"u64"},{"name":"bump","type":"u8"}]}},{"name":"BridgeSession","type":{"kind":"struct","fields":[{"name":"glam_state","type":"pubkey"},{"name":"signer","type":"pubkey"},{"name":"transfer_id","type":{"array":["u8",32]}},{"name":"protocol","type":"u16"},{"name":"managed","type":"bool"},{"name":"source_mint","type":"pubkey"},{"name":"source_token_account","type":"pubkey"},{"name":"provider_program","type":"pubkey"},{"name":"provider_config","type":"pubkey"},{"name":"provider_sender","type":"pubkey"},{"name":"provider_delegate","type":"pubkey"},{"name":"provider_receipt","type":"pubkey"},{"name":"provider_instruction_hash","type":{"array":["u8",32]}},{"name":"provider_instruction_count","type":"u16"},{"name":"source_amount","type":"u64"},{"name":"quoted_out_amount","type":"u64"},{"name":"initial_source_balance","type":"u64"},{"name":"initial_provider_sequence","type":"u64"},{"name":"destination_chain","type":"u16"},{"name":"destination_recipient","type":"pubkey"},{"name":"quote_expires_at","type":"i64"},{"name":"prepared_slot","type":"u64"},{"name":"bump","type":"u8"}]}},{"name":"BridgeTransferRecord","type":{"kind":"struct","fields":[{"name":"glam_state","type":"pubkey"},{"name":"transfer_id","type":{"array":["u8",32]}},{"name":"protocol","type":"u16"},{"name":"status","type":{"defined":{"name":"BridgeTransferStatus"}}},{"name":"managed","type":"bool"},{"name":"receipt_verified","type":"bool"},{"name":"source_mint","type":"pubkey"},{"name":"source_token_account","type":"pubkey"},{"name":"provider_program","type":"pubkey"},{"name":"provider_config","type":"pubkey"},{"name":"source_amount","type":"u64"},{"name":"quoted_out_amount","type":"u64"},{"name":"destination_chain","type":"u16"},{"name":"destination_recipient","type":"pubkey"},{"name":"provider_transfer_id","type":{"array":["u8",32]}},{"name":"provider_emitter","type":"pubkey"},{"name":"provider_sequence","type":"u64"},{"name":"committed_slot","type":"u64"},{"name":"settled_slot","type":"u64"},{"name":"reconciled_slot","type":"u64"},{"name":"failure_reason","type":"u8"},{"name":"bump","type":"u8"}]}},{"name":"BridgeTransferStatus","type":{"kind":"enum","variants":[{"name":"Committed"},{"name":"Settled"},{"name":"Reconciled"},{"name":"Failed"}]}},{"name":"CommitOftTransferArgs","type":{"kind":"struct","fields":[{"name":"transfer_id","type":{"array":["u8",32]}}]}},{"name":"CreatedModel","type":{"kind":"struct","fields":[{"name":"key","type":{"array":["u8",8]}},{"name":"created_by","type":"pubkey"},{"name":"created_at","type":"i64"}]}},{"name":"DelegateAcl","type":{"kind":"struct","fields":[{"name":"pubkey","type":"pubkey"},{"name":"integration_permissions","type":{"vec":{"defined":{"name":"IntegrationPermissions"}}}},{"name":"expires_at","type":"i64"}]}},{"name":"EngineField","type":{"kind":"struct","fields":[{"name":"name","type":{"defined":{"name":"EngineFieldName"}}},{"name":"value","type":{"defined":{"name":"EngineFieldValue"}}}]}},{"name":"EngineFieldName","type":{"kind":"enum","variants":[{"name":"Owner"},{"name":"PortfolioManagerName"},{"name":"Name"},{"name":"Uri"},{"name":"Assets"},{"name":"DelegateAcls"},{"name":"IntegrationAcls"},{"name":"TimelockDuration"},{"name":"Borrowable"},{"name":"DefaultAccountStateFrozen"},{"name":"PermanentDelegate"},{"name":"NotifyAndSettle"},{"name":"FeeStructure"},{"name":"FeeParams"},{"name":"ClaimableFees"},{"name":"ClaimedFees"},{"name":"OracleConfigs"}]}},{"name":"EngineFieldValue","type":{"kind":"enum","variants":[{"name":"Boolean","fields":[{"name":"val","type":"bool"}]},{"name":"U8","fields":[{"name":"val","type":"u8"}]},{"name":"U32","fields":[{"name":"val","type":"u32"}]},{"name":"U64","fields":[{"name":"val","type":"u64"}]},{"name":"String","fields":[{"name":"val","type":"string"}]},{"name":"Pubkey","fields":[{"name":"val","type":"pubkey"}]},{"name":"VecPubkey","fields":[{"name":"val","type":{"vec":"pubkey"}}]},{"name":"VecU8","fields":[{"name":"val","type":"bytes"}]},{"name":"VecU32","fields":[{"name":"val","type":{"vec":"u32"}}]},{"name":"VecDelegateAcl","fields":[{"name":"val","type":{"vec":{"defined":{"name":"DelegateAcl"}}}}]},{"name":"VecIntegrationAcl","fields":[{"name":"val","type":{"vec":{"defined":{"name":"IntegrationAcl"}}}}]},{"name":"FeeStructure","fields":[{"name":"val","type":{"defined":{"name":"FeeStructure"}}}]},{"name":"FeeParams","fields":[{"name":"val","type":{"defined":{"name":"FeeParams"}}}]},{"name":"AccruedFees","fields":[{"name":"val","type":{"defined":{"name":"AccruedFees"}}}]},{"name":"NotifyAndSettle","fields":[{"name":"val","type":{"defined":{"name":"NotifyAndSettle"}}}]},{"name":"OracleConfigs","fields":[{"name":"val","type":{"defined":{"name":"OracleConfigs"}}}]}]}},{"name":"EntryExitFees","type":{"kind":"struct","fields":[{"name":"subscription_fee_bps","type":"u16"},{"name":"redemption_fee_bps","type":"u16"}]}},{"name":"FeeParams","type":{"kind":"struct","fields":[{"name":"year_in_seconds","type":"u32"},{"name":"pa_high_water_mark","type":"i128"},{"name":"pa_last_nav","type":"i128"},{"name":"last_aum","type":"i128"},{"name":"last_performance_fee_crystallized","type":"i64"},{"name":"last_management_fee_crystallized","type":"i64"},{"name":"last_protocol_fee_crystallized","type":"i64"}]}},{"name":"FeeStructure","type":{"kind":"struct","fields":[{"name":"vault","type":{"defined":{"name":"EntryExitFees"}}},{"name":"manager","type":{"defined":{"name":"EntryExitFees"}}},{"name":"management","type":{"defined":{"name":"ManagementFee"}}},{"name":"performance","type":{"defined":{"name":"PerformanceFee"}}},{"name":"protocol","type":{"defined":{"name":"ProtocolFees"}}}]}},{"name":"HurdleType","type":{"kind":"enum","variants":[{"name":"Hard"},{"name":"Soft"}]}},{"name":"IntegrationAcl","docs":["An integration program can have multiple protocols supported.","Enabled protocols are stored in a bitmask, and each protocol can have its own policy."],"type":{"kind":"struct","fields":[{"name":"integration_program","type":"pubkey"},{"name":"protocols_bitmask","type":"u16"},{"name":"protocol_policies","type":{"vec":{"defined":{"name":"ProtocolPolicy"}}}}]}},{"name":"IntegrationPermissions","docs":["Stores delegate permissions for an integration program."],"type":{"kind":"struct","fields":[{"name":"integration_program","type":"pubkey"},{"name":"protocol_permissions","type":{"vec":{"defined":{"name":"ProtocolPermissions"}}}}]}},{"name":"LayerzeroOftRoute","docs":["source_mint, destination_chain, destination_recipient, provider_program uniquely identify a route"],"type":{"kind":"struct","fields":[{"name":"source_mint","type":"pubkey"},{"name":"destination_chain","type":"u32"},{"name":"destination_recipient","type":"pubkey"},{"name":"provider_program","type":"pubkey"},{"name":"management_mode","type":{"defined":{"name":"RouteManagementMode"}}},{"name":"min_amount","type":"u64"},{"name":"max_amount","type":"u64"}]}},{"name":"ManagementFee","type":{"kind":"struct","fields":[{"name":"fee_bps","type":"u16"}]}},{"name":"NoticePeriodType","type":{"kind":"enum","variants":[{"name":"Hard"},{"name":"Soft"}]}},{"name":"NotifyAndSettle","type":{"kind":"struct","fields":[{"name":"model","type":{"defined":{"name":"ValuationModel"}}},{"name":"permissionless_fulfillment","type":"bool"},{"name":"subscribe_notice_period_type","type":{"defined":{"name":"NoticePeriodType"}}},{"name":"subscribe_notice_period","type":"u64"},{"name":"subscribe_settlement_period","type":"u64"},{"name":"subscribe_cancellation_window","type":"u64"},{"name":"redeem_notice_period_type","type":{"defined":{"name":"NoticePeriodType"}}},{"name":"redeem_notice_period","type":"u64"},{"name":"redeem_settlement_period","type":"u64"},{"name":"redeem_cancellation_window","type":"u64"},{"name":"time_unit","type":{"defined":{"name":"TimeUnit"}}},{"name":"_padding","type":{"array":["u8",3]}}]}},{"name":"OracleConfigs","docs":["Vault-specific oracle configs. If available, these configs are preferred over the global config."],"type":{"kind":"struct","fields":[{"name":"max_ages_seconds","type":{"vec":{"array":["u16",2]}}},{"name":"padding","type":{"array":["u8",12]}}]}},{"name":"PerformanceFee","type":{"kind":"struct","fields":[{"name":"fee_bps","type":"u16"},{"name":"hurdle_rate_bps","type":"u16"},{"name":"hurdle_type","type":{"defined":{"name":"HurdleType"}}}]}},{"name":"PrepareOftTransferArgs","type":{"kind":"struct","fields":[{"name":"transfer_id","type":{"array":["u8",32]}},{"name":"middle_instruction_hash","type":{"array":["u8",32]}},{"name":"middle_instruction_count","type":"u16"},{"name":"source_amount","type":"u64"},{"name":"managed","type":"bool"}]}},{"name":"PricedProtocol","type":{"kind":"struct","fields":[{"name":"rent","type":"u64"},{"name":"amount","type":"i128"},{"name":"decimals","type":"u8"},{"name":"last_updated_slot","type":"u64"},{"name":"integration_program","type":"pubkey"},{"name":"protocol_bitflag","type":"u16"},{"name":"positions","type":{"vec":"pubkey"}}]}},{"name":"ProtocolFees","type":{"kind":"struct","fields":[{"name":"base_fee_bps","type":"u16"},{"name":"flow_fee_bps","type":"u16"}]}},{"name":"ProtocolPermissions","docs":["Represents a delegate\'s permissions for a specific protocol"],"type":{"kind":"struct","fields":[{"name":"protocol_bitflag","type":"u16"},{"name":"permissions_bitmask","type":"u64"}]}},{"name":"ProtocolPolicy","docs":["Stores policy data for an integrated protocol.","Integration programs serialize/deserialize this data."],"type":{"kind":"struct","fields":[{"name":"protocol_bitflag","type":"u16"},{"name":"data","type":"bytes"}]}},{"name":"RouteManagementMode","type":{"kind":"enum","variants":[{"name":"UnmanagedOnly"},{"name":"ManagedOnly"},{"name":"Either"}]}},{"name":"StateAccount","type":{"kind":"struct","fields":[{"name":"account_type","type":{"defined":{"name":"AccountType"}}},{"name":"enabled","type":"bool"},{"name":"vault","type":"pubkey"},{"name":"owner","type":"pubkey"},{"name":"portfolio_manager_name","type":{"array":["u8",32]}},{"name":"created","type":{"defined":{"name":"CreatedModel"}}},{"name":"base_asset_mint","type":"pubkey"},{"name":"base_asset_decimals","type":"u8"},{"name":"base_asset_token_program","type":"u8"},{"name":"name","type":{"array":["u8",32]}},{"name":"timelock_duration","type":"u32"},{"name":"timelock_expires_at","type":"u64"},{"name":"mint","type":"pubkey"},{"name":"assets","type":{"vec":"pubkey"}},{"name":"integration_acls","type":{"vec":{"defined":{"name":"IntegrationAcl"}}}},{"name":"delegate_acls","type":{"vec":{"defined":{"name":"DelegateAcl"}}}},{"name":"external_positions","type":{"vec":"pubkey"}},{"name":"priced_protocols","type":{"vec":{"defined":{"name":"PricedProtocol"}}}},{"name":"params","type":{"vec":{"vec":{"defined":{"name":"EngineField"}}}}}]}},{"name":"TimeUnit","type":{"kind":"enum","variants":[{"name":"Second"},{"name":"Slot"}]}},{"name":"ValuationModel","type":{"kind":"enum","variants":[{"name":"Continuous"},{"name":"Periodic"}]}}],"constants":[{"name":"PROTO_BRIDGE_PERM_RECONCILE","type":"u64","value":"2"},{"name":"PROTO_BRIDGE_PERM_SEND","type":"u64","value":"1"},{"name":"PROTO_LAYERZERO_OFT","type":"u16","value":"4"},{"name":"PROTO_MANAGED_INFLIGHT","type":"u16","value":"4"}]}');
|
|
275
275
|
|
|
276
276
|
/***/ }),
|
|
277
277
|
/* 15 */
|
|
@@ -327,7 +327,7 @@ module.exports = /*#__PURE__*/JSON.parse('{"address":"gstgmvM2o7h7GcScvXymH1oFgW
|
|
|
327
327
|
/***/ ((module) => {
|
|
328
328
|
|
|
329
329
|
"use strict";
|
|
330
|
-
module.exports = /*#__PURE__*/JSON.parse('{"address":"gstgxS9yTioViNKdsM4DC33k1TU9un2VCYDQK8fAeSA","metadata":{"name":"ext_bridge","version":"1.0.0","spec":"0.1.0","description":"Bridge integration for GLAM Protocol"},"instructions":[{"name":"add_layerzero_oft_route","discriminator":[53,181,204,38,240,57,218,148],"accounts":[{"name":"glam_state","writable":true},{"name":"glam_signer","writable":true,"signer":true},{"name":"glam_protocol_program","address":"gstgptmbgJVi5f8ZmSRVZjZkDQwqKa3xWuUtD5WmJHz"}],"args":[{"name":"route","type":{"defined":{"name":"LayerzeroOftRoute"}}}]},{"name":"cleanup_transfer_record","docs":["Closes a finalized transfer record and returns its rent."],"discriminator":[65,224,219,143,99,204,215,6],"accounts":[{"name":"glam_state"},{"name":"glam_signer","writable":true,"signer":true},{"name":"transfer_record","writable":true}],"args":[]},{"name":"commit_oft_transfer","docs":["Verifies the OFT send completed and records the resulting transfer."],"discriminator":[246,116,17,13,64,227,248,78],"accounts":[{"name":"glam_state","writable":true},{"name":"glam_vault","pda":{"seeds":[{"kind":"const","value":[118,97,117,108,116]},{"kind":"account","path":"glam_state"}],"program":{"kind":"account","path":"glam_protocol_program"}}},{"name":"glam_signer","writable":true,"signer":true},{"name":"integration_authority","pda":{"seeds":[{"kind":"const","value":[105,110,116,101,103,114,97,116,105,111,110,45,97,117,116,104,111,114,105,116,121]}]}},{"name":"cpi_program"},{"name":"glam_protocol_program","address":"gstgptmbgJVi5f8ZmSRVZjZkDQwqKa3xWuUtD5WmJHz"},{"name":"system_program","address":"11111111111111111111111111111111"},{"name":"instructions","address":"Sysvar1nstructions1111111111111111111111111"},{"name":"bridge_registry","writable":true,"pda":{"seeds":[{"kind":"const","value":[98,114,105,100,103,101,45,114,101,103,105,115,116,114,121]},{"kind":"account","path":"glam_state"}]}},{"name":"bridge_session","writable":true,"pda":{"seeds":[{"kind":"const","value":[98,114,105,100,103,101,45,115,101,115,115,105,111,110]},{"kind":"account","path":"glam_state"},{"kind":"arg","path":"args.transfer_id"}]}},{"name":"transfer_record","writable":true,"pda":{"seeds":[{"kind":"const","value":[98,114,105,100,103,101,45,116,114,97,110,115,102,101,114,45,114,101,99,111,114,100]},{"kind":"account","path":"glam_state"},{"kind":"arg","path":"args.transfer_id"}]}},{"name":"source_token_account","writable":true},{"name":"source_mint"},{"name":"auxiliary_token_account","writable":true}],"args":[{"name":"args","type":{"defined":{"name":"CommitOftTransferArgs"}}}]},{"name":"delete_layerzero_oft_route","discriminator":[122,191,90,182,160,67,86,227],"accounts":[{"name":"glam_state","writable":true},{"name":"glam_signer","writable":true,"signer":true},{"name":"glam_protocol_program","address":"gstgptmbgJVi5f8ZmSRVZjZkDQwqKa3xWuUtD5WmJHz"}],"args":[{"name":"route","type":{"defined":{"name":"LayerzeroOftRoute"}}}]},{"name":"fail_or_cancel_managed_transfer","docs":["Marks a managed inflight transfer as failed or cancelled."],"discriminator":[39,37,213,118,191,18,194,119],"accounts":[{"name":"glam_state","writable":true},{"name":"glam_vault","pda":{"seeds":[{"kind":"const","value":[118,97,117,108,116]},{"kind":"account","path":"glam_state"}],"program":{"kind":"account","path":"glam_protocol_program"}}},{"name":"glam_signer","signer":true},{"name":"integration_authority","pda":{"seeds":[{"kind":"const","value":[105,110,116,101,103,114,97,116,105,111,110,45,97,117,116,104,111,114,105,116,121]}]}},{"name":"glam_protocol_program","address":"gstgptmbgJVi5f8ZmSRVZjZkDQwqKa3xWuUtD5WmJHz"},{"name":"system_program","address":"11111111111111111111111111111111"},{"name":"bridge_registry","writable":true,"pda":{"seeds":[{"kind":"const","value":[98,114,105,100,103,101,45,114,101,103,105,115,116,114,121]},{"kind":"account","path":"glam_state"}]}},{"name":"transfer_record","writable":true}],"args":[{"name":"failure_reason","type":"u8"}]},{"name":"prepare_oft_transfer","docs":["Prepares the auxiliary token account used by the OFT transfer flow."],"discriminator":[192,75,97,92,178,246,220,8],"accounts":[{"name":"glam_state","writable":true},{"name":"glam_vault","writable":true,"pda":{"seeds":[{"kind":"const","value":[118,97,117,108,116]},{"kind":"account","path":"glam_state"}],"program":{"kind":"account","path":"glam_protocol_program"}}},{"name":"glam_signer","writable":true,"signer":true},{"name":"integration_authority","pda":{"seeds":[{"kind":"const","value":[105,110,116,101,103,114,97,116,105,111,110,45,97,117,116,104,111,114,105,116,121]}]}},{"name":"bridge_registry","writable":true,"pda":{"seeds":[{"kind":"const","value":[98,114,105,100,103,101,45,114,101,103,105,115,116,114,121]},{"kind":"account","path":"glam_state"}]}},{"name":"bridge_session","writable":true,"pda":{"seeds":[{"kind":"const","value":[98,114,105,100,103,101,45,115,101,115,115,105,111,110]},{"kind":"account","path":"glam_state"},{"kind":"arg","path":"args.transfer_id"}]}},{"name":"source_token_account","writable":true},{"name":"source_mint"},{"name":"auxiliary_token_account","writable":true},{"name":"cpi_program"},{"name":"glam_protocol_program","address":"gstgptmbgJVi5f8ZmSRVZjZkDQwqKa3xWuUtD5WmJHz"},{"name":"system_program","address":"11111111111111111111111111111111"},{"name":"instructions","address":"Sysvar1nstructions1111111111111111111111111"}],"args":[{"name":"args","type":{"defined":{"name":"PrepareOftTransferArgs"}}}]},{"name":"reconcile_managed_transfer","docs":["Reconciles a managed inflight transfer back into normal pricing state."],"discriminator":[137,31,188,80,28,252,192,50],"accounts":[{"name":"glam_state","writable":true},{"name":"glam_vault","writable":true,"pda":{"seeds":[{"kind":"const","value":[118,97,117,108,116]},{"kind":"account","path":"glam_state"}],"program":{"kind":"account","path":"glam_protocol_program"}}},{"name":"glam_signer","signer":true},{"name":"integration_authority","pda":{"seeds":[{"kind":"const","value":[105,110,116,101,103,114,97,116,105,111,110,45,97,117,116,104,111,114,105,116,121]}]}},{"name":"glam_protocol_program","address":"gstgptmbgJVi5f8ZmSRVZjZkDQwqKa3xWuUtD5WmJHz"},{"name":"system_program","address":"11111111111111111111111111111111"},{"name":"bridge_registry","writable":true,"pda":{"seeds":[{"kind":"const","value":[98,114,105,100,103,101,45,114,101,103,105,115,116,114,121]},{"kind":"account","path":"glam_state"}]}},{"name":"transfer_record","writable":true}],"args":[]},{"name":"set_layerzero_oft_policy","docs":["Stores the LayerZero OFT route allowlist for this vault."],"discriminator":[184,54,57,172,193,178,200,70],"accounts":[{"name":"glam_state","writable":true},{"name":"glam_signer","writable":true,"signer":true},{"name":"glam_protocol_program","address":"gstgptmbgJVi5f8ZmSRVZjZkDQwqKa3xWuUtD5WmJHz"}],"args":[{"name":"policy","type":{"defined":{"name":"LayerzeroOftPolicy"}}}]},{"name":"settle_managed_transfer","docs":["Marks a managed inflight transfer as settled on the destination side."],"discriminator":[197,87,37,239,24,244,152,135],"accounts":[{"name":"glam_state"},{"name":"glam_signer","signer":true},{"name":"transfer_record","writable":true}],"args":[]},{"name":"update_layerzero_oft_route","discriminator":[77,162,99,1,182,142,66,172],"accounts":[{"name":"glam_state","writable":true},{"name":"glam_signer","writable":true,"signer":true},{"name":"glam_protocol_program","address":"gstgptmbgJVi5f8ZmSRVZjZkDQwqKa3xWuUtD5WmJHz"}],"args":[{"name":"route","type":{"defined":{"name":"LayerzeroOftRoute"}}}]}],"accounts":[{"name":"BridgeRegistry","discriminator":[178,207,65,53,51,157,148,202]},{"name":"BridgeSession","discriminator":[235,118,90,227,230,173,141,184]},{"name":"BridgeTransferRecord","discriminator":[46,131,253,32,218,137,45,96]},{"name":"StateAccount","discriminator":[142,247,54,95,85,133,249,103]}],"errors":[{"code":6000,"name":"UnsupportedProtocol","msg":"Unsupported bridge protocol"},{"code":6001,"name":"PolicyNotFound","msg":"A matching bridge policy was not found"},{"code":6002,"name":"AmountTooSmall","msg":"Bridge amount is below the policy minimum"},{"code":6003,"name":"AmountTooLarge","msg":"Bridge amount exceeds the policy maximum"},{"code":6004,"name":"InvalidProviderProgram","msg":"The provider program does not match the approved policy"},{"code":6005,"name":"InvalidSourceTokenAccount","msg":"The source token account is invalid"},{"code":6006,"name":"InvalidSourceBalance","msg":"The source token balance did not change as expected"},{"code":6007,"name":"InvalidProviderReceipt","msg":"The bridge receipt metadata is invalid"},{"code":6008,"name":"InvalidTransferStatus","msg":"The bridge transfer status does not allow this action"},{"code":6009,"name":"TransferNotManaged","msg":"Only managed transfers can use this instruction"},{"code":6010,"name":"MathOverflow","msg":"Arithmetic overflow"},{"code":6011,"name":"InvalidTransferRecord","msg":"The transfer record does not belong to this vault"},{"code":6012,"name":"TooManyProviderInstructions","msg":"Too many provider instructions were supplied"},{"code":6013,"name":"DuplicateBridgeRoute","msg":"Bridge policy contains overlapping duplicate routes"},{"code":6014,"name":"BridgeRouteNotFound","msg":"The bridge route was not found in the existing policy"},{"code":6015,"name":"AmbiguousBridgeRoute","msg":"Multiple bridge routes matched; disambiguate the provider identity"},{"code":6016,"name":"InvalidOftAuxiliaryTokenAccount","msg":"The OFT auxiliary token account is invalid"},{"code":6017,"name":"OftAuxiliaryTokenAccountAlreadyExists","msg":"The OFT auxiliary token account already exists"},{"code":6018,"name":"MissingEndOftInstruction","msg":"Transaction must include a matching commit_oft_transfer instruction"},{"code":6019,"name":"InvalidOftInstructionSet","msg":"The OFT middle instruction set is invalid"},{"code":6020,"name":"InvalidOftAuxiliaryBalance","msg":"The OFT auxiliary token balance did not change as expected"}],"types":[{"name":"AccountType","type":{"kind":"enum","variants":[{"name":"Vault"},{"name":"TokenizedVault"},{"name":"Mint"},{"name":"SingleAssetVault"}]}},{"name":"AccruedFees","type":{"kind":"struct","fields":[{"name":"vault_subscription_fee","type":"u128"},{"name":"vault_redemption_fee","type":"u128"},{"name":"manager_subscription_fee","type":"u128"},{"name":"manager_redemption_fee","type":"u128"},{"name":"management_fee","type":"u128"},{"name":"performance_fee","type":"u128"},{"name":"protocol_base_fee","type":"u128"},{"name":"protocol_flow_fee","type":"u128"}]}},{"name":"BridgeRegistry","type":{"kind":"struct","fields":[{"name":"glam_state","type":"pubkey"},{"name":"managed_transfer_count","type":"u64"},{"name":"bump","type":"u8"}]}},{"name":"BridgeSession","type":{"kind":"struct","fields":[{"name":"glam_state","type":"pubkey"},{"name":"signer","type":"pubkey"},{"name":"transfer_id","type":{"array":["u8",32]}},{"name":"protocol","type":"u16"},{"name":"managed","type":"bool"},{"name":"source_mint","type":"pubkey"},{"name":"source_token_account","type":"pubkey"},{"name":"provider_program","type":"pubkey"},{"name":"provider_config","type":"pubkey"},{"name":"provider_sender","type":"pubkey"},{"name":"provider_delegate","type":"pubkey"},{"name":"provider_receipt","type":"pubkey"},{"name":"provider_instruction_hash","type":{"array":["u8",32]}},{"name":"provider_instruction_count","type":"u16"},{"name":"source_amount","type":"u64"},{"name":"quoted_out_amount","type":"u64"},{"name":"initial_source_balance","type":"u64"},{"name":"initial_provider_sequence","type":"u64"},{"name":"destination_chain","type":"u16"},{"name":"destination_recipient","type":"pubkey"},{"name":"quote_expires_at","type":"i64"},{"name":"prepared_slot","type":"u64"},{"name":"bump","type":"u8"}]}},{"name":"BridgeTransferRecord","type":{"kind":"struct","fields":[{"name":"glam_state","type":"pubkey"},{"name":"transfer_id","type":{"array":["u8",32]}},{"name":"protocol","type":"u16"},{"name":"status","type":{"defined":{"name":"BridgeTransferStatus"}}},{"name":"managed","type":"bool"},{"name":"receipt_verified","type":"bool"},{"name":"source_mint","type":"pubkey"},{"name":"source_token_account","type":"pubkey"},{"name":"provider_program","type":"pubkey"},{"name":"provider_config","type":"pubkey"},{"name":"source_amount","type":"u64"},{"name":"quoted_out_amount","type":"u64"},{"name":"destination_chain","type":"u16"},{"name":"destination_recipient","type":"pubkey"},{"name":"provider_transfer_id","type":{"array":["u8",32]}},{"name":"provider_emitter","type":"pubkey"},{"name":"provider_sequence","type":"u64"},{"name":"committed_slot","type":"u64"},{"name":"settled_slot","type":"u64"},{"name":"reconciled_slot","type":"u64"},{"name":"failure_reason","type":"u8"},{"name":"bump","type":"u8"}]}},{"name":"BridgeTransferStatus","type":{"kind":"enum","variants":[{"name":"Committed"},{"name":"Settled"},{"name":"Reconciled"},{"name":"Failed"}]}},{"name":"CommitOftTransferArgs","type":{"kind":"struct","fields":[{"name":"transfer_id","type":{"array":["u8",32]}}]}},{"name":"CreatedModel","type":{"kind":"struct","fields":[{"name":"key","type":{"array":["u8",8]}},{"name":"created_by","type":"pubkey"},{"name":"created_at","type":"i64"}]}},{"name":"DelegateAcl","type":{"kind":"struct","fields":[{"name":"pubkey","type":"pubkey"},{"name":"integration_permissions","type":{"vec":{"defined":{"name":"IntegrationPermissions"}}}},{"name":"expires_at","type":"i64"}]}},{"name":"EngineField","type":{"kind":"struct","fields":[{"name":"name","type":{"defined":{"name":"EngineFieldName"}}},{"name":"value","type":{"defined":{"name":"EngineFieldValue"}}}]}},{"name":"EngineFieldName","type":{"kind":"enum","variants":[{"name":"Owner"},{"name":"PortfolioManagerName"},{"name":"Name"},{"name":"Uri"},{"name":"Assets"},{"name":"DelegateAcls"},{"name":"IntegrationAcls"},{"name":"TimelockDuration"},{"name":"Borrowable"},{"name":"DefaultAccountStateFrozen"},{"name":"PermanentDelegate"},{"name":"NotifyAndSettle"},{"name":"FeeStructure"},{"name":"FeeParams"},{"name":"ClaimableFees"},{"name":"ClaimedFees"},{"name":"OracleConfigs"}]}},{"name":"EngineFieldValue","type":{"kind":"enum","variants":[{"name":"Boolean","fields":[{"name":"val","type":"bool"}]},{"name":"U8","fields":[{"name":"val","type":"u8"}]},{"name":"U32","fields":[{"name":"val","type":"u32"}]},{"name":"U64","fields":[{"name":"val","type":"u64"}]},{"name":"String","fields":[{"name":"val","type":"string"}]},{"name":"Pubkey","fields":[{"name":"val","type":"pubkey"}]},{"name":"VecPubkey","fields":[{"name":"val","type":{"vec":"pubkey"}}]},{"name":"VecU8","fields":[{"name":"val","type":"bytes"}]},{"name":"VecU32","fields":[{"name":"val","type":{"vec":"u32"}}]},{"name":"VecDelegateAcl","fields":[{"name":"val","type":{"vec":{"defined":{"name":"DelegateAcl"}}}}]},{"name":"VecIntegrationAcl","fields":[{"name":"val","type":{"vec":{"defined":{"name":"IntegrationAcl"}}}}]},{"name":"FeeStructure","fields":[{"name":"val","type":{"defined":{"name":"FeeStructure"}}}]},{"name":"FeeParams","fields":[{"name":"val","type":{"defined":{"name":"FeeParams"}}}]},{"name":"AccruedFees","fields":[{"name":"val","type":{"defined":{"name":"AccruedFees"}}}]},{"name":"NotifyAndSettle","fields":[{"name":"val","type":{"defined":{"name":"NotifyAndSettle"}}}]},{"name":"OracleConfigs","fields":[{"name":"val","type":{"defined":{"name":"OracleConfigs"}}}]}]}},{"name":"EntryExitFees","type":{"kind":"struct","fields":[{"name":"subscription_fee_bps","type":"u16"},{"name":"redemption_fee_bps","type":"u16"}]}},{"name":"FeeParams","type":{"kind":"struct","fields":[{"name":"year_in_seconds","type":"u32"},{"name":"pa_high_water_mark","type":"i128"},{"name":"pa_last_nav","type":"i128"},{"name":"last_aum","type":"i128"},{"name":"last_performance_fee_crystallized","type":"i64"},{"name":"last_management_fee_crystallized","type":"i64"},{"name":"last_protocol_fee_crystallized","type":"i64"}]}},{"name":"FeeStructure","type":{"kind":"struct","fields":[{"name":"vault","type":{"defined":{"name":"EntryExitFees"}}},{"name":"manager","type":{"defined":{"name":"EntryExitFees"}}},{"name":"management","type":{"defined":{"name":"ManagementFee"}}},{"name":"performance","type":{"defined":{"name":"PerformanceFee"}}},{"name":"protocol","type":{"defined":{"name":"ProtocolFees"}}}]}},{"name":"HurdleType","type":{"kind":"enum","variants":[{"name":"Hard"},{"name":"Soft"}]}},{"name":"IntegrationAcl","docs":["An integration program can have multiple protocols supported.","Enabled protocols are stored in a bitmask, and each protocol can have its own policy."],"type":{"kind":"struct","fields":[{"name":"integration_program","type":"pubkey"},{"name":"protocols_bitmask","type":"u16"},{"name":"protocol_policies","type":{"vec":{"defined":{"name":"ProtocolPolicy"}}}}]}},{"name":"IntegrationPermissions","docs":["Stores delegate permissions for an integration program."],"type":{"kind":"struct","fields":[{"name":"integration_program","type":"pubkey"},{"name":"protocol_permissions","type":{"vec":{"defined":{"name":"ProtocolPermissions"}}}}]}},{"name":"LayerzeroOftPolicy","type":{"kind":"struct","fields":[{"name":"routes","type":{"vec":{"defined":{"name":"LayerzeroOftRoute"}}}}]}},{"name":"LayerzeroOftRoute","type":{"kind":"struct","fields":[{"name":"source_mint","type":"pubkey"},{"name":"destination_chain","type":"u32"},{"name":"destination_recipient","type":"pubkey"},{"name":"provider_program","type":"pubkey"},{"name":"management_mode","type":{"defined":{"name":"RouteManagementMode"}}},{"name":"min_amount","type":"u64"},{"name":"max_amount","type":"u64"}]}},{"name":"ManagementFee","type":{"kind":"struct","fields":[{"name":"fee_bps","type":"u16"}]}},{"name":"NoticePeriodType","type":{"kind":"enum","variants":[{"name":"Hard"},{"name":"Soft"}]}},{"name":"NotifyAndSettle","type":{"kind":"struct","fields":[{"name":"model","type":{"defined":{"name":"ValuationModel"}}},{"name":"permissionless_fulfillment","type":"bool"},{"name":"subscribe_notice_period_type","type":{"defined":{"name":"NoticePeriodType"}}},{"name":"subscribe_notice_period","type":"u64"},{"name":"subscribe_settlement_period","type":"u64"},{"name":"subscribe_cancellation_window","type":"u64"},{"name":"redeem_notice_period_type","type":{"defined":{"name":"NoticePeriodType"}}},{"name":"redeem_notice_period","type":"u64"},{"name":"redeem_settlement_period","type":"u64"},{"name":"redeem_cancellation_window","type":"u64"},{"name":"time_unit","type":{"defined":{"name":"TimeUnit"}}},{"name":"_padding","type":{"array":["u8",3]}}]}},{"name":"OracleConfigs","docs":["Vault-specific oracle configs. If available, these configs are preferred over the global config."],"type":{"kind":"struct","fields":[{"name":"max_ages_seconds","type":{"vec":{"array":["u16",2]}}},{"name":"padding","type":{"array":["u8",12]}}]}},{"name":"PerformanceFee","type":{"kind":"struct","fields":[{"name":"fee_bps","type":"u16"},{"name":"hurdle_rate_bps","type":"u16"},{"name":"hurdle_type","type":{"defined":{"name":"HurdleType"}}}]}},{"name":"PrepareOftTransferArgs","type":{"kind":"struct","fields":[{"name":"transfer_id","type":{"array":["u8",32]}},{"name":"middle_instruction_hash","type":{"array":["u8",32]}},{"name":"middle_instruction_count","type":"u16"},{"name":"source_amount","type":"u64"},{"name":"managed","type":"bool"}]}},{"name":"PricedProtocol","type":{"kind":"struct","fields":[{"name":"rent","type":"u64"},{"name":"amount","type":"i128"},{"name":"decimals","type":"u8"},{"name":"last_updated_slot","type":"u64"},{"name":"integration_program","type":"pubkey"},{"name":"protocol_bitflag","type":"u16"},{"name":"positions","type":{"vec":"pubkey"}}]}},{"name":"ProtocolFees","type":{"kind":"struct","fields":[{"name":"base_fee_bps","type":"u16"},{"name":"flow_fee_bps","type":"u16"}]}},{"name":"ProtocolPermissions","docs":["Represents a delegate\'s permissions for a specific protocol"],"type":{"kind":"struct","fields":[{"name":"protocol_bitflag","type":"u16"},{"name":"permissions_bitmask","type":"u64"}]}},{"name":"ProtocolPolicy","docs":["Stores policy data for an integrated protocol.","Integration programs serialize/deserialize this data."],"type":{"kind":"struct","fields":[{"name":"protocol_bitflag","type":"u16"},{"name":"data","type":"bytes"}]}},{"name":"RouteManagementMode","type":{"kind":"enum","variants":[{"name":"UnmanagedOnly"},{"name":"ManagedOnly"},{"name":"Either"}]}},{"name":"StateAccount","type":{"kind":"struct","fields":[{"name":"account_type","type":{"defined":{"name":"AccountType"}}},{"name":"enabled","type":"bool"},{"name":"vault","type":"pubkey"},{"name":"owner","type":"pubkey"},{"name":"portfolio_manager_name","type":{"array":["u8",32]}},{"name":"created","type":{"defined":{"name":"CreatedModel"}}},{"name":"base_asset_mint","type":"pubkey"},{"name":"base_asset_decimals","type":"u8"},{"name":"base_asset_token_program","type":"u8"},{"name":"name","type":{"array":["u8",32]}},{"name":"timelock_duration","type":"u32"},{"name":"timelock_expires_at","type":"u64"},{"name":"mint","type":"pubkey"},{"name":"assets","type":{"vec":"pubkey"}},{"name":"integration_acls","type":{"vec":{"defined":{"name":"IntegrationAcl"}}}},{"name":"delegate_acls","type":{"vec":{"defined":{"name":"DelegateAcl"}}}},{"name":"external_positions","type":{"vec":"pubkey"}},{"name":"priced_protocols","type":{"vec":{"defined":{"name":"PricedProtocol"}}}},{"name":"params","type":{"vec":{"vec":{"defined":{"name":"EngineField"}}}}}]}},{"name":"TimeUnit","type":{"kind":"enum","variants":[{"name":"Second"},{"name":"Slot"}]}},{"name":"ValuationModel","type":{"kind":"enum","variants":[{"name":"Continuous"},{"name":"Periodic"}]}}],"constants":[{"name":"PROTO_BRIDGE_PERM_RECONCILE","type":"u64","value":"2"},{"name":"PROTO_BRIDGE_PERM_SEND","type":"u64","value":"1"},{"name":"PROTO_LAYERZERO_OFT","type":"u16","value":"4"},{"name":"PROTO_MANAGED_INFLIGHT","type":"u16","value":"4"}]}');
|
|
330
|
+
module.exports = /*#__PURE__*/JSON.parse('{"address":"gstgxS9yTioViNKdsM4DC33k1TU9un2VCYDQK8fAeSA","metadata":{"name":"ext_bridge","version":"1.0.0","spec":"0.1.0","description":"Bridge integration for GLAM Protocol"},"instructions":[{"name":"add_layerzero_oft_route","discriminator":[53,181,204,38,240,57,218,148],"accounts":[{"name":"glam_state","writable":true},{"name":"glam_signer","writable":true,"signer":true},{"name":"glam_protocol_program","address":"gstgptmbgJVi5f8ZmSRVZjZkDQwqKa3xWuUtD5WmJHz"}],"args":[{"name":"route","type":{"defined":{"name":"LayerzeroOftRoute"}}}]},{"name":"cleanup_transfer_record","docs":["Closes a finalized transfer record and returns its rent."],"discriminator":[65,224,219,143,99,204,215,6],"accounts":[{"name":"glam_state"},{"name":"glam_signer","writable":true,"signer":true},{"name":"transfer_record","writable":true}],"args":[]},{"name":"commit_oft_transfer","docs":["Verifies the OFT send completed and records the resulting transfer."],"discriminator":[246,116,17,13,64,227,248,78],"accounts":[{"name":"glam_state","writable":true},{"name":"glam_vault","writable":true,"pda":{"seeds":[{"kind":"const","value":[118,97,117,108,116]},{"kind":"account","path":"glam_state"}],"program":{"kind":"account","path":"glam_protocol_program"}}},{"name":"glam_signer","writable":true,"signer":true},{"name":"integration_authority","pda":{"seeds":[{"kind":"const","value":[105,110,116,101,103,114,97,116,105,111,110,45,97,117,116,104,111,114,105,116,121]}]}},{"name":"cpi_program"},{"name":"glam_protocol_program","address":"gstgptmbgJVi5f8ZmSRVZjZkDQwqKa3xWuUtD5WmJHz"},{"name":"system_program","address":"11111111111111111111111111111111"},{"name":"instructions","address":"Sysvar1nstructions1111111111111111111111111"},{"name":"bridge_registry","writable":true,"pda":{"seeds":[{"kind":"const","value":[98,114,105,100,103,101,45,114,101,103,105,115,116,114,121]},{"kind":"account","path":"glam_state"}]}},{"name":"bridge_session","writable":true,"pda":{"seeds":[{"kind":"const","value":[98,114,105,100,103,101,45,115,101,115,115,105,111,110]},{"kind":"account","path":"glam_state"},{"kind":"arg","path":"args.transfer_id"}]}},{"name":"transfer_record","writable":true,"pda":{"seeds":[{"kind":"const","value":[98,114,105,100,103,101,45,116,114,97,110,115,102,101,114,45,114,101,99,111,114,100]},{"kind":"account","path":"glam_state"},{"kind":"arg","path":"args.transfer_id"}]}},{"name":"source_token_account","writable":true},{"name":"source_mint"},{"name":"auxiliary_token_account","writable":true}],"args":[{"name":"args","type":{"defined":{"name":"CommitOftTransferArgs"}}}]},{"name":"delete_layerzero_oft_route","discriminator":[122,191,90,182,160,67,86,227],"accounts":[{"name":"glam_state","writable":true},{"name":"glam_signer","writable":true,"signer":true},{"name":"glam_protocol_program","address":"gstgptmbgJVi5f8ZmSRVZjZkDQwqKa3xWuUtD5WmJHz"}],"args":[{"name":"route","type":{"defined":{"name":"LayerzeroOftRoute"}}}]},{"name":"fail_or_cancel_managed_transfer","docs":["Marks a managed inflight transfer as failed or cancelled."],"discriminator":[39,37,213,118,191,18,194,119],"accounts":[{"name":"glam_state","writable":true},{"name":"glam_vault","writable":true,"pda":{"seeds":[{"kind":"const","value":[118,97,117,108,116]},{"kind":"account","path":"glam_state"}],"program":{"kind":"account","path":"glam_protocol_program"}}},{"name":"glam_signer","signer":true},{"name":"integration_authority","pda":{"seeds":[{"kind":"const","value":[105,110,116,101,103,114,97,116,105,111,110,45,97,117,116,104,111,114,105,116,121]}]}},{"name":"glam_protocol_program","address":"gstgptmbgJVi5f8ZmSRVZjZkDQwqKa3xWuUtD5WmJHz"},{"name":"system_program","address":"11111111111111111111111111111111"},{"name":"bridge_registry","writable":true,"pda":{"seeds":[{"kind":"const","value":[98,114,105,100,103,101,45,114,101,103,105,115,116,114,121]},{"kind":"account","path":"glam_state"}]}},{"name":"transfer_record","writable":true}],"args":[{"name":"failure_reason","type":"u8"}]},{"name":"prepare_oft_transfer","docs":["Prepares the auxiliary token account used by the OFT transfer flow."],"discriminator":[192,75,97,92,178,246,220,8],"accounts":[{"name":"glam_state","writable":true},{"name":"glam_vault","writable":true,"pda":{"seeds":[{"kind":"const","value":[118,97,117,108,116]},{"kind":"account","path":"glam_state"}],"program":{"kind":"account","path":"glam_protocol_program"}}},{"name":"glam_signer","writable":true,"signer":true},{"name":"integration_authority","pda":{"seeds":[{"kind":"const","value":[105,110,116,101,103,114,97,116,105,111,110,45,97,117,116,104,111,114,105,116,121]}]}},{"name":"bridge_registry","writable":true,"pda":{"seeds":[{"kind":"const","value":[98,114,105,100,103,101,45,114,101,103,105,115,116,114,121]},{"kind":"account","path":"glam_state"}]}},{"name":"bridge_session","writable":true,"pda":{"seeds":[{"kind":"const","value":[98,114,105,100,103,101,45,115,101,115,115,105,111,110]},{"kind":"account","path":"glam_state"},{"kind":"arg","path":"args.transfer_id"}]}},{"name":"source_token_account","writable":true},{"name":"source_mint"},{"name":"auxiliary_token_account","writable":true},{"name":"cpi_program"},{"name":"glam_protocol_program","address":"gstgptmbgJVi5f8ZmSRVZjZkDQwqKa3xWuUtD5WmJHz"},{"name":"system_program","address":"11111111111111111111111111111111"},{"name":"instructions","address":"Sysvar1nstructions1111111111111111111111111"}],"args":[{"name":"args","type":{"defined":{"name":"PrepareOftTransferArgs"}}}]},{"name":"reconcile_managed_transfer","docs":["Reconciles a managed inflight transfer back into normal pricing state."],"discriminator":[137,31,188,80,28,252,192,50],"accounts":[{"name":"glam_state","writable":true},{"name":"glam_vault","writable":true,"pda":{"seeds":[{"kind":"const","value":[118,97,117,108,116]},{"kind":"account","path":"glam_state"}],"program":{"kind":"account","path":"glam_protocol_program"}}},{"name":"glam_signer","signer":true},{"name":"integration_authority","pda":{"seeds":[{"kind":"const","value":[105,110,116,101,103,114,97,116,105,111,110,45,97,117,116,104,111,114,105,116,121]}]}},{"name":"glam_protocol_program","address":"gstgptmbgJVi5f8ZmSRVZjZkDQwqKa3xWuUtD5WmJHz"},{"name":"system_program","address":"11111111111111111111111111111111"},{"name":"bridge_registry","writable":true,"pda":{"seeds":[{"kind":"const","value":[98,114,105,100,103,101,45,114,101,103,105,115,116,114,121]},{"kind":"account","path":"glam_state"}]}},{"name":"transfer_record","writable":true}],"args":[]},{"name":"settle_managed_transfer","docs":["Marks a managed inflight transfer as settled on the destination side."],"discriminator":[197,87,37,239,24,244,152,135],"accounts":[{"name":"glam_state"},{"name":"glam_signer","signer":true},{"name":"transfer_record","writable":true}],"args":[]},{"name":"update_layerzero_oft_route","discriminator":[77,162,99,1,182,142,66,172],"accounts":[{"name":"glam_state","writable":true},{"name":"glam_signer","writable":true,"signer":true},{"name":"glam_protocol_program","address":"gstgptmbgJVi5f8ZmSRVZjZkDQwqKa3xWuUtD5WmJHz"}],"args":[{"name":"route","type":{"defined":{"name":"LayerzeroOftRoute"}}}]}],"accounts":[{"name":"BridgeRegistry","discriminator":[178,207,65,53,51,157,148,202]},{"name":"BridgeSession","discriminator":[235,118,90,227,230,173,141,184]},{"name":"BridgeTransferRecord","discriminator":[46,131,253,32,218,137,45,96]},{"name":"StateAccount","discriminator":[142,247,54,95,85,133,249,103]}],"errors":[{"code":6000,"name":"UnsupportedProtocol","msg":"Unsupported bridge protocol"},{"code":6001,"name":"PolicyNotFound","msg":"A matching bridge policy was not found"},{"code":6002,"name":"AmountTooSmall","msg":"Bridge amount is below the policy minimum"},{"code":6003,"name":"AmountTooLarge","msg":"Bridge amount exceeds the policy maximum"},{"code":6004,"name":"InvalidProviderProgram","msg":"The provider program does not match the approved policy"},{"code":6005,"name":"InvalidSourceTokenAccount","msg":"The source token account is invalid"},{"code":6006,"name":"InvalidSourceBalance","msg":"The source token balance did not change as expected"},{"code":6007,"name":"InvalidProviderReceipt","msg":"The bridge receipt metadata is invalid"},{"code":6008,"name":"InvalidTransferStatus","msg":"The bridge transfer status does not allow this action"},{"code":6009,"name":"TransferNotManaged","msg":"Only managed transfers can use this instruction"},{"code":6010,"name":"MathOverflow","msg":"Arithmetic overflow"},{"code":6011,"name":"InvalidTransferRecord","msg":"The transfer record does not belong to this vault"},{"code":6012,"name":"TooManyProviderInstructions","msg":"Too many provider instructions were supplied"},{"code":6013,"name":"DuplicateBridgeRoute","msg":"Bridge policy contains overlapping duplicate routes"},{"code":6014,"name":"BridgeRouteNotFound","msg":"The bridge route was not found in the existing policy"},{"code":6015,"name":"AmbiguousBridgeRoute","msg":"Multiple bridge routes matched; disambiguate the provider identity"},{"code":6016,"name":"InvalidOftAuxiliaryTokenAccount","msg":"The OFT auxiliary token account is invalid"},{"code":6017,"name":"OftAuxiliaryTokenAccountAlreadyExists","msg":"The OFT auxiliary token account already exists"},{"code":6018,"name":"MissingEndOftInstruction","msg":"Transaction must include a matching commit_oft_transfer instruction"},{"code":6019,"name":"InvalidOftInstructionSet","msg":"The OFT middle instruction set is invalid"},{"code":6020,"name":"InvalidOftAuxiliaryBalance","msg":"The OFT auxiliary token balance did not change as expected"}],"types":[{"name":"AccountType","type":{"kind":"enum","variants":[{"name":"Vault"},{"name":"TokenizedVault"},{"name":"Mint"},{"name":"SingleAssetVault"}]}},{"name":"AccruedFees","type":{"kind":"struct","fields":[{"name":"vault_subscription_fee","type":"u128"},{"name":"vault_redemption_fee","type":"u128"},{"name":"manager_subscription_fee","type":"u128"},{"name":"manager_redemption_fee","type":"u128"},{"name":"management_fee","type":"u128"},{"name":"performance_fee","type":"u128"},{"name":"protocol_base_fee","type":"u128"},{"name":"protocol_flow_fee","type":"u128"}]}},{"name":"BridgeRegistry","type":{"kind":"struct","fields":[{"name":"glam_state","type":"pubkey"},{"name":"managed_transfer_count","type":"u64"},{"name":"bump","type":"u8"}]}},{"name":"BridgeSession","type":{"kind":"struct","fields":[{"name":"glam_state","type":"pubkey"},{"name":"signer","type":"pubkey"},{"name":"transfer_id","type":{"array":["u8",32]}},{"name":"protocol","type":"u16"},{"name":"managed","type":"bool"},{"name":"source_mint","type":"pubkey"},{"name":"source_token_account","type":"pubkey"},{"name":"provider_program","type":"pubkey"},{"name":"provider_config","type":"pubkey"},{"name":"provider_sender","type":"pubkey"},{"name":"provider_delegate","type":"pubkey"},{"name":"provider_receipt","type":"pubkey"},{"name":"provider_instruction_hash","type":{"array":["u8",32]}},{"name":"provider_instruction_count","type":"u16"},{"name":"source_amount","type":"u64"},{"name":"quoted_out_amount","type":"u64"},{"name":"initial_source_balance","type":"u64"},{"name":"initial_provider_sequence","type":"u64"},{"name":"destination_chain","type":"u16"},{"name":"destination_recipient","type":"pubkey"},{"name":"quote_expires_at","type":"i64"},{"name":"prepared_slot","type":"u64"},{"name":"bump","type":"u8"}]}},{"name":"BridgeTransferRecord","type":{"kind":"struct","fields":[{"name":"glam_state","type":"pubkey"},{"name":"transfer_id","type":{"array":["u8",32]}},{"name":"protocol","type":"u16"},{"name":"status","type":{"defined":{"name":"BridgeTransferStatus"}}},{"name":"managed","type":"bool"},{"name":"receipt_verified","type":"bool"},{"name":"source_mint","type":"pubkey"},{"name":"source_token_account","type":"pubkey"},{"name":"provider_program","type":"pubkey"},{"name":"provider_config","type":"pubkey"},{"name":"source_amount","type":"u64"},{"name":"quoted_out_amount","type":"u64"},{"name":"destination_chain","type":"u16"},{"name":"destination_recipient","type":"pubkey"},{"name":"provider_transfer_id","type":{"array":["u8",32]}},{"name":"provider_emitter","type":"pubkey"},{"name":"provider_sequence","type":"u64"},{"name":"committed_slot","type":"u64"},{"name":"settled_slot","type":"u64"},{"name":"reconciled_slot","type":"u64"},{"name":"failure_reason","type":"u8"},{"name":"bump","type":"u8"}]}},{"name":"BridgeTransferStatus","type":{"kind":"enum","variants":[{"name":"Committed"},{"name":"Settled"},{"name":"Reconciled"},{"name":"Failed"}]}},{"name":"CommitOftTransferArgs","type":{"kind":"struct","fields":[{"name":"transfer_id","type":{"array":["u8",32]}}]}},{"name":"CreatedModel","type":{"kind":"struct","fields":[{"name":"key","type":{"array":["u8",8]}},{"name":"created_by","type":"pubkey"},{"name":"created_at","type":"i64"}]}},{"name":"DelegateAcl","type":{"kind":"struct","fields":[{"name":"pubkey","type":"pubkey"},{"name":"integration_permissions","type":{"vec":{"defined":{"name":"IntegrationPermissions"}}}},{"name":"expires_at","type":"i64"}]}},{"name":"EngineField","type":{"kind":"struct","fields":[{"name":"name","type":{"defined":{"name":"EngineFieldName"}}},{"name":"value","type":{"defined":{"name":"EngineFieldValue"}}}]}},{"name":"EngineFieldName","type":{"kind":"enum","variants":[{"name":"Owner"},{"name":"PortfolioManagerName"},{"name":"Name"},{"name":"Uri"},{"name":"Assets"},{"name":"DelegateAcls"},{"name":"IntegrationAcls"},{"name":"TimelockDuration"},{"name":"Borrowable"},{"name":"DefaultAccountStateFrozen"},{"name":"PermanentDelegate"},{"name":"NotifyAndSettle"},{"name":"FeeStructure"},{"name":"FeeParams"},{"name":"ClaimableFees"},{"name":"ClaimedFees"},{"name":"OracleConfigs"}]}},{"name":"EngineFieldValue","type":{"kind":"enum","variants":[{"name":"Boolean","fields":[{"name":"val","type":"bool"}]},{"name":"U8","fields":[{"name":"val","type":"u8"}]},{"name":"U32","fields":[{"name":"val","type":"u32"}]},{"name":"U64","fields":[{"name":"val","type":"u64"}]},{"name":"String","fields":[{"name":"val","type":"string"}]},{"name":"Pubkey","fields":[{"name":"val","type":"pubkey"}]},{"name":"VecPubkey","fields":[{"name":"val","type":{"vec":"pubkey"}}]},{"name":"VecU8","fields":[{"name":"val","type":"bytes"}]},{"name":"VecU32","fields":[{"name":"val","type":{"vec":"u32"}}]},{"name":"VecDelegateAcl","fields":[{"name":"val","type":{"vec":{"defined":{"name":"DelegateAcl"}}}}]},{"name":"VecIntegrationAcl","fields":[{"name":"val","type":{"vec":{"defined":{"name":"IntegrationAcl"}}}}]},{"name":"FeeStructure","fields":[{"name":"val","type":{"defined":{"name":"FeeStructure"}}}]},{"name":"FeeParams","fields":[{"name":"val","type":{"defined":{"name":"FeeParams"}}}]},{"name":"AccruedFees","fields":[{"name":"val","type":{"defined":{"name":"AccruedFees"}}}]},{"name":"NotifyAndSettle","fields":[{"name":"val","type":{"defined":{"name":"NotifyAndSettle"}}}]},{"name":"OracleConfigs","fields":[{"name":"val","type":{"defined":{"name":"OracleConfigs"}}}]}]}},{"name":"EntryExitFees","type":{"kind":"struct","fields":[{"name":"subscription_fee_bps","type":"u16"},{"name":"redemption_fee_bps","type":"u16"}]}},{"name":"FeeParams","type":{"kind":"struct","fields":[{"name":"year_in_seconds","type":"u32"},{"name":"pa_high_water_mark","type":"i128"},{"name":"pa_last_nav","type":"i128"},{"name":"last_aum","type":"i128"},{"name":"last_performance_fee_crystallized","type":"i64"},{"name":"last_management_fee_crystallized","type":"i64"},{"name":"last_protocol_fee_crystallized","type":"i64"}]}},{"name":"FeeStructure","type":{"kind":"struct","fields":[{"name":"vault","type":{"defined":{"name":"EntryExitFees"}}},{"name":"manager","type":{"defined":{"name":"EntryExitFees"}}},{"name":"management","type":{"defined":{"name":"ManagementFee"}}},{"name":"performance","type":{"defined":{"name":"PerformanceFee"}}},{"name":"protocol","type":{"defined":{"name":"ProtocolFees"}}}]}},{"name":"HurdleType","type":{"kind":"enum","variants":[{"name":"Hard"},{"name":"Soft"}]}},{"name":"IntegrationAcl","docs":["An integration program can have multiple protocols supported.","Enabled protocols are stored in a bitmask, and each protocol can have its own policy."],"type":{"kind":"struct","fields":[{"name":"integration_program","type":"pubkey"},{"name":"protocols_bitmask","type":"u16"},{"name":"protocol_policies","type":{"vec":{"defined":{"name":"ProtocolPolicy"}}}}]}},{"name":"IntegrationPermissions","docs":["Stores delegate permissions for an integration program."],"type":{"kind":"struct","fields":[{"name":"integration_program","type":"pubkey"},{"name":"protocol_permissions","type":{"vec":{"defined":{"name":"ProtocolPermissions"}}}}]}},{"name":"LayerzeroOftRoute","docs":["source_mint, destination_chain, destination_recipient, provider_program uniquely identify a route"],"type":{"kind":"struct","fields":[{"name":"source_mint","type":"pubkey"},{"name":"destination_chain","type":"u32"},{"name":"destination_recipient","type":"pubkey"},{"name":"provider_program","type":"pubkey"},{"name":"management_mode","type":{"defined":{"name":"RouteManagementMode"}}},{"name":"min_amount","type":"u64"},{"name":"max_amount","type":"u64"}]}},{"name":"ManagementFee","type":{"kind":"struct","fields":[{"name":"fee_bps","type":"u16"}]}},{"name":"NoticePeriodType","type":{"kind":"enum","variants":[{"name":"Hard"},{"name":"Soft"}]}},{"name":"NotifyAndSettle","type":{"kind":"struct","fields":[{"name":"model","type":{"defined":{"name":"ValuationModel"}}},{"name":"permissionless_fulfillment","type":"bool"},{"name":"subscribe_notice_period_type","type":{"defined":{"name":"NoticePeriodType"}}},{"name":"subscribe_notice_period","type":"u64"},{"name":"subscribe_settlement_period","type":"u64"},{"name":"subscribe_cancellation_window","type":"u64"},{"name":"redeem_notice_period_type","type":{"defined":{"name":"NoticePeriodType"}}},{"name":"redeem_notice_period","type":"u64"},{"name":"redeem_settlement_period","type":"u64"},{"name":"redeem_cancellation_window","type":"u64"},{"name":"time_unit","type":{"defined":{"name":"TimeUnit"}}},{"name":"_padding","type":{"array":["u8",3]}}]}},{"name":"OracleConfigs","docs":["Vault-specific oracle configs. If available, these configs are preferred over the global config."],"type":{"kind":"struct","fields":[{"name":"max_ages_seconds","type":{"vec":{"array":["u16",2]}}},{"name":"padding","type":{"array":["u8",12]}}]}},{"name":"PerformanceFee","type":{"kind":"struct","fields":[{"name":"fee_bps","type":"u16"},{"name":"hurdle_rate_bps","type":"u16"},{"name":"hurdle_type","type":{"defined":{"name":"HurdleType"}}}]}},{"name":"PrepareOftTransferArgs","type":{"kind":"struct","fields":[{"name":"transfer_id","type":{"array":["u8",32]}},{"name":"middle_instruction_hash","type":{"array":["u8",32]}},{"name":"middle_instruction_count","type":"u16"},{"name":"source_amount","type":"u64"},{"name":"managed","type":"bool"}]}},{"name":"PricedProtocol","type":{"kind":"struct","fields":[{"name":"rent","type":"u64"},{"name":"amount","type":"i128"},{"name":"decimals","type":"u8"},{"name":"last_updated_slot","type":"u64"},{"name":"integration_program","type":"pubkey"},{"name":"protocol_bitflag","type":"u16"},{"name":"positions","type":{"vec":"pubkey"}}]}},{"name":"ProtocolFees","type":{"kind":"struct","fields":[{"name":"base_fee_bps","type":"u16"},{"name":"flow_fee_bps","type":"u16"}]}},{"name":"ProtocolPermissions","docs":["Represents a delegate\'s permissions for a specific protocol"],"type":{"kind":"struct","fields":[{"name":"protocol_bitflag","type":"u16"},{"name":"permissions_bitmask","type":"u64"}]}},{"name":"ProtocolPolicy","docs":["Stores policy data for an integrated protocol.","Integration programs serialize/deserialize this data."],"type":{"kind":"struct","fields":[{"name":"protocol_bitflag","type":"u16"},{"name":"data","type":"bytes"}]}},{"name":"RouteManagementMode","type":{"kind":"enum","variants":[{"name":"UnmanagedOnly"},{"name":"ManagedOnly"},{"name":"Either"}]}},{"name":"StateAccount","type":{"kind":"struct","fields":[{"name":"account_type","type":{"defined":{"name":"AccountType"}}},{"name":"enabled","type":"bool"},{"name":"vault","type":"pubkey"},{"name":"owner","type":"pubkey"},{"name":"portfolio_manager_name","type":{"array":["u8",32]}},{"name":"created","type":{"defined":{"name":"CreatedModel"}}},{"name":"base_asset_mint","type":"pubkey"},{"name":"base_asset_decimals","type":"u8"},{"name":"base_asset_token_program","type":"u8"},{"name":"name","type":{"array":["u8",32]}},{"name":"timelock_duration","type":"u32"},{"name":"timelock_expires_at","type":"u64"},{"name":"mint","type":"pubkey"},{"name":"assets","type":{"vec":"pubkey"}},{"name":"integration_acls","type":{"vec":{"defined":{"name":"IntegrationAcl"}}}},{"name":"delegate_acls","type":{"vec":{"defined":{"name":"DelegateAcl"}}}},{"name":"external_positions","type":{"vec":"pubkey"}},{"name":"priced_protocols","type":{"vec":{"defined":{"name":"PricedProtocol"}}}},{"name":"params","type":{"vec":{"vec":{"defined":{"name":"EngineField"}}}}}]}},{"name":"TimeUnit","type":{"kind":"enum","variants":[{"name":"Second"},{"name":"Slot"}]}},{"name":"ValuationModel","type":{"kind":"enum","variants":[{"name":"Continuous"},{"name":"Periodic"}]}}],"constants":[{"name":"PROTO_BRIDGE_PERM_RECONCILE","type":"u64","value":"2"},{"name":"PROTO_BRIDGE_PERM_SEND","type":"u64","value":"1"},{"name":"PROTO_LAYERZERO_OFT","type":"u16","value":"4"},{"name":"PROTO_MANAGED_INFLIGHT","type":"u16","value":"4"}]}');
|
|
331
331
|
|
|
332
332
|
/***/ }),
|
|
333
333
|
/* 23 */
|
|
@@ -4198,19 +4198,52 @@ class BaseClient {
|
|
|
4198
4198
|
}
|
|
4199
4199
|
const fetchPromise = this.fetchGlobalConfig(options)
|
|
4200
4200
|
.then(async (globalConfig) => {
|
|
4201
|
-
|
|
4202
|
-
const
|
|
4201
|
+
const assets = globalConfig.assetMetas.map((am) => am.asset);
|
|
4202
|
+
const tokenProgramsByAsset = new Map();
|
|
4203
|
+
try {
|
|
4204
|
+
// Fast path when every global-config mint account is available.
|
|
4205
|
+
const mintInfos = await (0, accounts_1.fetchMintsAndTokenPrograms)(this.connection, assets);
|
|
4206
|
+
assets.forEach((asset, i) => {
|
|
4207
|
+
tokenProgramsByAsset.set(asset.toBase58(), mintInfos[i].tokenProgram);
|
|
4208
|
+
});
|
|
4209
|
+
}
|
|
4210
|
+
catch {
|
|
4211
|
+
// Local validators may clone a newer global config than the set of
|
|
4212
|
+
// mint accounts they have available. Resolve what we can and let
|
|
4213
|
+
// downstream callers request only the assets they actually use.
|
|
4214
|
+
const accountsInfo = await this.connection.getMultipleAccountsInfo(assets, "confirmed");
|
|
4215
|
+
accountsInfo.forEach((accountInfo, i) => {
|
|
4216
|
+
const asset = assets[i];
|
|
4217
|
+
const assetKey = asset.toBase58();
|
|
4218
|
+
if (accountInfo) {
|
|
4219
|
+
tokenProgramsByAsset.set(assetKey, (0, accounts_1.parseMintAccountInfo)(accountInfo, asset).tokenProgram);
|
|
4220
|
+
return;
|
|
4221
|
+
}
|
|
4222
|
+
const fallback = assets_1.ASSETS_MAINNET.get(assetKey);
|
|
4223
|
+
if (fallback) {
|
|
4224
|
+
tokenProgramsByAsset.set(assetKey, fallback.programId);
|
|
4225
|
+
}
|
|
4226
|
+
});
|
|
4227
|
+
}
|
|
4203
4228
|
// Transforms onchain asset meta to client asset meta
|
|
4204
|
-
const assetMetaMap = new Map(globalConfig.assetMetas.
|
|
4205
|
-
asset.toBase58()
|
|
4206
|
-
{
|
|
4207
|
-
|
|
4208
|
-
|
|
4209
|
-
|
|
4210
|
-
|
|
4211
|
-
|
|
4212
|
-
|
|
4213
|
-
|
|
4229
|
+
const assetMetaMap = new Map(globalConfig.assetMetas.flatMap(({ asset, decimals, oracle, oracleSource }) => {
|
|
4230
|
+
const programId = tokenProgramsByAsset.get(asset.toBase58());
|
|
4231
|
+
if (!programId) {
|
|
4232
|
+
return [];
|
|
4233
|
+
}
|
|
4234
|
+
return [
|
|
4235
|
+
[
|
|
4236
|
+
asset.toBase58(),
|
|
4237
|
+
{
|
|
4238
|
+
asset,
|
|
4239
|
+
decimals,
|
|
4240
|
+
oracle,
|
|
4241
|
+
oracleSource,
|
|
4242
|
+
programId,
|
|
4243
|
+
},
|
|
4244
|
+
],
|
|
4245
|
+
];
|
|
4246
|
+
}));
|
|
4214
4247
|
if (useCache) {
|
|
4215
4248
|
this._assetMetas = assetMetaMap;
|
|
4216
4249
|
}
|
|
@@ -10581,10 +10614,10 @@ class TxBuilder extends base_1.BaseTxBuilder {
|
|
|
10581
10614
|
async deleteLayerzeroOftRouteIx(route, signer) {
|
|
10582
10615
|
return await this.client.base.extBridgeProgram.methods
|
|
10583
10616
|
.deleteLayerzeroOftRoute(normalizeRoute(route))
|
|
10584
|
-
.
|
|
10617
|
+
.accounts({
|
|
10585
10618
|
glamState: this.client.base.statePda,
|
|
10586
10619
|
glamSigner: signer || this.client.base.signer,
|
|
10587
|
-
glamProtocolProgram: this.client.base.protocolProgram.programId,
|
|
10620
|
+
// glamProtocolProgram: this.client.base.protocolProgram.programId,
|
|
10588
10621
|
})
|
|
10589
10622
|
.instruction();
|
|
10590
10623
|
}
|
|
@@ -10951,12 +10984,17 @@ class BridgeClient {
|
|
|
10951
10984
|
return await this.base.sendAndConfirm(tx);
|
|
10952
10985
|
}
|
|
10953
10986
|
async reconcileManagedTransfer(transferId, txOptions = {}) {
|
|
10987
|
+
const integrationAuthority = web3_js_1.PublicKey.findProgramAddressSync([Buffer.from(constants_1.SEED_INTEGRATION_AUTHORITY)], this.base.extBridgeProgram.programId)[0];
|
|
10954
10988
|
const ix = await this.base.extBridgeProgram.methods
|
|
10955
10989
|
.reconcileManagedTransfer()
|
|
10956
|
-
.
|
|
10990
|
+
.accounts({
|
|
10957
10991
|
glamState: this.base.statePda,
|
|
10992
|
+
// glamVault: this.base.vaultPda,
|
|
10958
10993
|
glamSigner: txOptions.signer || this.base.signer,
|
|
10959
|
-
|
|
10994
|
+
// integrationAuthority,
|
|
10995
|
+
// glamProtocolProgram: this.base.protocolProgram.programId,
|
|
10996
|
+
// systemProgram: SystemProgram.programId,
|
|
10997
|
+
// bridgeRegistry: this.getRegistryPda(),
|
|
10960
10998
|
transferRecord: this.getTransferRecordPda(transferId),
|
|
10961
10999
|
})
|
|
10962
11000
|
.instruction();
|
|
@@ -49353,6 +49391,7 @@ function installBridgeCommands(program, context) {
|
|
|
49353
49391
|
"use strict";
|
|
49354
49392
|
|
|
49355
49393
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
49394
|
+
exports.parsePositionId = parsePositionId;
|
|
49356
49395
|
exports.installEpiCommands = installEpiCommands;
|
|
49357
49396
|
const tslib_1 = __webpack_require__(2);
|
|
49358
49397
|
const anchor_1 = __webpack_require__(4);
|
|
@@ -49372,18 +49411,57 @@ function parseHexOrBase64Bytes(value, label) {
|
|
|
49372
49411
|
}
|
|
49373
49412
|
return bytes;
|
|
49374
49413
|
}
|
|
49414
|
+
function encodePositionIdString(value) {
|
|
49415
|
+
const bytes = Buffer.from(value, "utf8");
|
|
49416
|
+
if (bytes.length === 0) {
|
|
49417
|
+
throw new Error("position must not be empty");
|
|
49418
|
+
}
|
|
49419
|
+
if (bytes.length > 32) {
|
|
49420
|
+
throw new Error("position must be a pubkey, exactly 32 decoded bytes, or a UTF-8 string up to 32 bytes");
|
|
49421
|
+
}
|
|
49422
|
+
const encoded = Buffer.alloc(32);
|
|
49423
|
+
bytes.copy(encoded);
|
|
49424
|
+
return Array.from(encoded);
|
|
49425
|
+
}
|
|
49375
49426
|
function parsePositionId(value) {
|
|
49427
|
+
const normalized = value.trim();
|
|
49376
49428
|
try {
|
|
49377
|
-
return Array.from(new web3_js_1.PublicKey(
|
|
49429
|
+
return Array.from(new web3_js_1.PublicKey(normalized).toBytes());
|
|
49378
49430
|
}
|
|
49379
49431
|
catch {
|
|
49380
|
-
|
|
49381
|
-
|
|
49382
|
-
|
|
49432
|
+
try {
|
|
49433
|
+
const bytes = parseHexOrBase64Bytes(normalized, "position");
|
|
49434
|
+
if (bytes.length === 32) {
|
|
49435
|
+
return Array.from(bytes);
|
|
49436
|
+
}
|
|
49383
49437
|
}
|
|
49384
|
-
|
|
49438
|
+
catch { }
|
|
49439
|
+
return encodePositionIdString(normalized);
|
|
49385
49440
|
}
|
|
49386
49441
|
}
|
|
49442
|
+
function formatPositionLabel(value, positionId) {
|
|
49443
|
+
const normalized = value.trim();
|
|
49444
|
+
try {
|
|
49445
|
+
new web3_js_1.PublicKey(normalized);
|
|
49446
|
+
return formatPositionId(positionId);
|
|
49447
|
+
}
|
|
49448
|
+
catch { }
|
|
49449
|
+
try {
|
|
49450
|
+
const bytes = parseHexOrBase64Bytes(normalized, "position");
|
|
49451
|
+
if (bytes.length === 32) {
|
|
49452
|
+
return formatPositionId(positionId);
|
|
49453
|
+
}
|
|
49454
|
+
}
|
|
49455
|
+
catch { }
|
|
49456
|
+
return `${JSON.stringify(normalized)} (${formatPositionId(positionId)})`;
|
|
49457
|
+
}
|
|
49458
|
+
function parsePosition(value) {
|
|
49459
|
+
const positionId = parsePositionId(value);
|
|
49460
|
+
return {
|
|
49461
|
+
positionId,
|
|
49462
|
+
positionLabel: formatPositionLabel(value, positionId),
|
|
49463
|
+
};
|
|
49464
|
+
}
|
|
49387
49465
|
function formatPositionId(positionId) {
|
|
49388
49466
|
return new web3_js_1.PublicKey(Uint8Array.from(positionId)).toBase58();
|
|
49389
49467
|
}
|
|
@@ -49462,7 +49540,7 @@ function installEpiCommands(program, context) {
|
|
|
49462
49540
|
program
|
|
49463
49541
|
.command("upsert-position")
|
|
49464
49542
|
.description("Create or update a tracked external position, including bridge transfer record PDAs")
|
|
49465
|
-
.argument("<position>", "tracked external position pubkey, transfer record PDA, or 32-byte position id")
|
|
49543
|
+
.argument("<position>", "tracked external position pubkey, transfer record PDA, UTF-8 string id, or 32-byte encoded position id")
|
|
49466
49544
|
.option("--denom <denom>", "observation denomination: usd or mint", "usd")
|
|
49467
49545
|
.option("--mint <pubkey>", "mint address when --denom mint")
|
|
49468
49546
|
.option("--freshness-secs <u32>", "freshness override in seconds, defaults to 0", "0")
|
|
@@ -49473,8 +49551,7 @@ function installEpiCommands(program, context) {
|
|
|
49473
49551
|
.option("--disabled", "upsert with enabled=false", false)
|
|
49474
49552
|
.option("-y, --yes", "Skip confirmation", false)
|
|
49475
49553
|
.action(async (position, options) => {
|
|
49476
|
-
const positionId =
|
|
49477
|
-
const positionLabel = formatPositionId(positionId);
|
|
49554
|
+
const { positionId, positionLabel } = parsePosition(position);
|
|
49478
49555
|
const { denomination, label } = await resolveDenomination(context, {
|
|
49479
49556
|
denom: options.denom,
|
|
49480
49557
|
mint: options.mint,
|
|
@@ -49504,7 +49581,7 @@ function installEpiCommands(program, context) {
|
|
|
49504
49581
|
program
|
|
49505
49582
|
.command("submit")
|
|
49506
49583
|
.description("Submit an observation for a tracked external position or transfer record PDA")
|
|
49507
|
-
.argument("<position>", "tracked external position pubkey, transfer record PDA, or 32-byte position id")
|
|
49584
|
+
.argument("<position>", "tracked external position pubkey, transfer record PDA, UTF-8 string id, or 32-byte encoded position id")
|
|
49508
49585
|
.argument("<amount>", "signed UI amount in the specified observation denomination")
|
|
49509
49586
|
.option("--denom <denom>", "observation denomination: usd or mint", "usd")
|
|
49510
49587
|
.option("--mint <pubkey>", "mint address when --denom mint")
|
|
@@ -49512,14 +49589,13 @@ function installEpiCommands(program, context) {
|
|
|
49512
49589
|
.option("--external-shares <raw-u64>", "external shares for tokenized positions, defaults to 0", "0")
|
|
49513
49590
|
.option("-y, --yes", "Skip confirmation", false)
|
|
49514
49591
|
.action(async (position, amount, options) => {
|
|
49515
|
-
const positionId =
|
|
49592
|
+
const { positionId, positionLabel } = parsePosition(position);
|
|
49516
49593
|
const { denomination, decimals, label } = await resolveDenomination(context, options);
|
|
49517
49594
|
const observationTimestamp = options.timestamp !== undefined
|
|
49518
49595
|
? parseSignedInteger(options.timestamp, "--timestamp")
|
|
49519
49596
|
: new anchor_1.BN(Math.floor(Date.now() / 1000));
|
|
49520
49597
|
const externalShares = parseUnsignedInteger(options.externalShares || "0", "--external-shares");
|
|
49521
49598
|
const amountBn = parseSignedUiAmount(amount, decimals, "amount");
|
|
49522
|
-
const positionLabel = formatPositionId(positionId);
|
|
49523
49599
|
await (0, utils_1.executeTxWithErrorHandling)(() => context.glamClient.epi.submitExternalObservation({
|
|
49524
49600
|
positionId,
|
|
49525
49601
|
amount: amountBn,
|
|
@@ -49534,16 +49610,15 @@ function installEpiCommands(program, context) {
|
|
|
49534
49610
|
program
|
|
49535
49611
|
.command("validate")
|
|
49536
49612
|
.description("Validate a pending observation for a tracked external position")
|
|
49537
|
-
.argument("<position>", "tracked external position pubkey, transfer record PDA, or 32-byte position id")
|
|
49613
|
+
.argument("<position>", "tracked external position pubkey, transfer record PDA, UTF-8 string id, or 32-byte encoded position id")
|
|
49538
49614
|
.option("--normalized-base-asset-amount <amount>", "signed UI amount in the vault base asset; omit to submit None")
|
|
49539
49615
|
.option("-y, --yes", "Skip confirmation", false)
|
|
49540
49616
|
.action(async (position, options) => {
|
|
49541
|
-
const positionId =
|
|
49617
|
+
const { positionId, positionLabel } = parsePosition(position);
|
|
49542
49618
|
const stateModel = await fetchStateModel(context);
|
|
49543
49619
|
const normalizedBaseAssetAmount = options.normalizedBaseAssetAmount === undefined
|
|
49544
49620
|
? null
|
|
49545
49621
|
: parseSignedUiAmount(options.normalizedBaseAssetAmount, stateModel.baseAssetDecimals, "--normalized-base-asset-amount");
|
|
49546
|
-
const positionLabel = formatPositionId(positionId);
|
|
49547
49622
|
const normalizedAmountLabel = options.normalizedBaseAssetAmount === undefined
|
|
49548
49623
|
? "None"
|
|
49549
49624
|
: `${options.normalizedBaseAssetAmount} ${stateModel.baseAssetMint.toBase58()}`;
|
|
@@ -50233,7 +50308,7 @@ program
|
|
|
50233
50308
|
initialize(config, skipSimulation);
|
|
50234
50309
|
await (0, idl_1.idlCheck)(context.glamClient);
|
|
50235
50310
|
})
|
|
50236
|
-
.version("1.0.14-alpha.
|
|
50311
|
+
.version("1.0.14-alpha.2");
|
|
50237
50312
|
program
|
|
50238
50313
|
.command("env")
|
|
50239
50314
|
.description("Display current environment setup")
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@glamsystems/glam-cli",
|
|
3
|
-
"version": "1.0.14-alpha.
|
|
3
|
+
"version": "1.0.14-alpha.2",
|
|
4
4
|
"description": "CLI for interacting with the GLAM Protocol",
|
|
5
5
|
"main": "./main.js",
|
|
6
6
|
"bin": {
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"node": ">=20.20.0"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@glamsystems/glam-sdk": "1.0.14-alpha.
|
|
24
|
+
"@glamsystems/glam-sdk": "1.0.14-alpha.2",
|
|
25
25
|
"@switchboard-xyz/common": "^3.0.0",
|
|
26
26
|
"commander": "^11.1.0",
|
|
27
27
|
"decimal.js": "^10.6.0",
|