import { Buffer } from "buffer";
import { Address } from '@stellar/stellar-sdk';
import {
  AssembledTransaction,
  AssembledTransactionOptions,
  Client as ContractClient,
  ClientOptions as ContractClientOptions,
  MethodOptions,
  Result,
  Spec as ContractSpec,
} from '@stellar/stellar-sdk/contract';
import type {
  u32,
  i32,
  u64,
  i64,
  u128,
  i128,
  u256,
  i256,
  Option,
  Typepoint,
  Duration,
} from '@stellar/stellar-sdk/contract';
export * from '@stellar/stellar-sdk'
export * as contract from '@stellar/stellar-sdk/contract'
export * as rpc from '@stellar/stellar-sdk/rpc'

// Soroban SDK types referenced in contract specs but not defined in the contract itself.
// InvokerContractAuthEntry is a Soroban built-in encoded as ScVal:
//   scvVec([symbol("Contract"), scvMap({
//     context: scvMap({ args, contract, fn_name }),
//     sub_invocations: scvVec([...])
//   })])
// Must be manually constructed — the contract spec's nativeToScVal cannot serialize it.
import type { xdr } from '@stellar/stellar-sdk';
export type InvokerContractAuthEntry = xdr.ScVal;

/**
 * Embedded WASM bytecode (base64-encoded)
 * Size: 7575 bytes (7.40 KB)
 */
export const WASM_BASE64 = " ";

/**
 * Pre-computed WASM hash (SHA-256)
 * Use this when the WASM is already uploaded on-chain
 */
export const WASM_HASH = "7796fed7be887c8f281a3c6e043203c0597969b65d23d5c1f9d767b62dfba062";

/**
 * Get the WASM bytecode as a Buffer
 * Use this to upload the WASM to the network
 */
export function getWasmBuffer(): Buffer {
  return Buffer.from(WASM_BASE64, 'base64');
}

/**
 * BufferReaderError: 1000-1009
 */
export const BufferReaderError = {
  1000: {message:"InvalidLength"},
  1001: {message:"InvalidAddressPayload"}
}

/**
 * BufferWriterError: 1010-1019
 */
export const BufferWriterError = {
  1010: {message:"InvalidAddressPayload"}
}

/**
 * TtlConfigurableError: 1020-1029
 */
export const TtlConfigurableError = {
  1020: {message:"InvalidTtlConfig"},
  1021: {message:"TtlConfigFrozen"},
  1022: {message:"TtlConfigAlreadyFrozen"}
}

/**
 * OwnableError: 1030-1039
 */
export const OwnableError = {
  1030: {message:"InvalidAuthorizer"},
  1031: {message:"InvalidPendingOwner"},
  1032: {message:"InvalidTtl"},
  1033: {message:"NoPendingTransfer"},
  1034: {message:"OwnerAlreadySet"},
  1035: {message:"OwnerNotSet"},
  1036: {message:"TransferInProgress"}
}

/**
 * BytesExtError: 1040-1049
 */
export const BytesExtError = {
  1040: {message:"LengthMismatch"}
}

/**
 * UpgradeableError: 1050-1059
 */
export const UpgradeableError = {
  1050: {message:"InvalidMigrationData"},
  1051: {message:"MigrationNotAllowed"}
}

/**
 * MultiSigError: 1060-1069
 */
export const MultiSigError = {
  1060: {message:"AlreadyInitialized"},
  1061: {message:"InvalidAuthorizer"},
  1062: {message:"InvalidSigner"},
  1063: {message:"SignatureError"},
  1064: {message:"SignerAlreadyExists"},
  1065: {message:"SignerNotFound"},
  1066: {message:"TotalSignersLessThanThreshold"},
  1067: {message:"UnsortedSigners"},
  1068: {message:"ZeroThreshold"}
}

/**
 * AuthError: 1070-1079
 */
export const AuthError = {
  1070: {message:"AuthorizerNotFound"}
}

/**
 * RbacError: 1080-1089
 */
export const RbacError = {
  1080: {message:"AdminRoleNotFound"},
  1081: {message:"IndexOutOfBounds"},
  1082: {message:"MaxRolesExceeded"},
  1083: {message:"RoleIsEmpty"},
  1084: {message:"RoleNotFound"},
  1085: {message:"RoleNotHeld"},
  1086: {message:"Unauthorized"}
}



export type MultiSigStorage = {tag: "Signers", values: void} | {tag: "Threshold", values: void};





export type OwnableStorage = {tag: "Owner", values: void} | {tag: "PendingOwner", values: void};




export type RbacStorage = {tag: "ExistingRoles", values: void} | {tag: "RoleIndexToAccount", values: readonly [string, u32]} | {tag: "RoleAccountToIndex", values: readonly [string, string]} | {tag: "RoleAccountsCount", values: readonly [string]} | {tag: "RoleAdmin", values: readonly [string]};


/**
 * TTL configuration: threshold (when to extend) and extend_to (target TTL).
 */
export interface TtlConfig {
  /**
 * Target TTL after extension (in ledgers).
 */
extend_to: u32;
  /**
 * TTL threshold that triggers extension (in ledgers).
 */
threshold: u32;
}



export type TtlConfigStorage = {tag: "Frozen", values: void} | {tag: "Instance", values: void} | {tag: "Persistent", values: void};

export type UpgradeableStorage = {tag: "Migrating", values: void};

export interface Client {
  /**
   * Construct and simulate a upgrade transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
   * Upgrades a target contract without custom migration data.
   * 
   * Convenience wrapper around [`upgrade_and_migrate`](Self::upgrade_and_migrate) that
   * passes empty migration data (XDR encoding of `()`). Use only when the target’s
   * `MigrationData` is `()` or it supports empty migration.
   * 
   * # Arguments
   * * `contract_address` - Address of the contract to upgrade.
   * * `wasm_hash` - Hash of the new WASM bytecode.
   * * `operator` - `None` for Auth-based targets; `Some(addr)` for RBAC-based targets
   */
  upgrade: ({contract_address, wasm_hash, operator}: {contract_address: string, wasm_hash: Buffer, operator: Option<string>}, txnOptions?: MethodOptions) => Promise<AssembledTransaction<null>>

  /**
   * Construct and simulate a upgrade_and_migrate transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
   * Upgrades a target contract and runs its migration in a single transaction.
   * 
   * Chooses Auth-based or RBAC-based flow from `operator`:
   * - **`Some(operator)`**: RBAC flow. `operator` must sign the transaction and must have
   * `UPGRADER_ROLE` on the target. The target must implement [`UpgradeableRbac`](utils::upgradeable::UpgradeableRbac).
   * - **`None`**: Auth flow. The target’s authorizer must sign the transaction. The target
   * must implement [`Upgradeable`](utils::upgradeable::Upgradeable).
   * 
   * # Arguments
   * * `contract_address` - Address of the contract to upgrade.
   * * `wasm_hash` - Hash of the new WASM bytecode.
   * * `migration_data` - XDR-encoded migration payload. Use `value.to_xdr(&env)` for the
   * target contract’s `MigrationData` type; use `().to_xdr(&env)` for no custom data.
   * * `operator` - `None` for Auth-based target; `Some(operator)` for RBAC-based target.
   * 
   * # Example
   * ```ignore
   * let migration_data = my_data.to_xdr(&env);
   * upgrader.upgrade_and_migrate(&contract_addr, &wasm_hash, &migration_data, &None);
   * ```
   */
  upgrade_and_migrate: ({contract_address, wasm_hash, migration_data, operator}: {contract_address: string, wasm_hash: Buffer, migration_data: Buffer, operator: Option<string>}, txnOptions?: MethodOptions) => Promise<AssembledTransaction<null>>

}
export class Client extends ContractClient {
  static async deploy<T = Client>(
    /** Options for initializing a Client as well as for calling a method, with extras specific to deploying. */
    options: MethodOptions &
      Omit<ContractClientOptions, "contractId"> & {
        /** The hash of the Wasm blob, which must already be installed on-chain. */
        wasmHash: Buffer | string;
        /** Salt used to generate the contract's ID. Passed through to {@link Operation.createCustomContract}. Default: random. */
        salt?: Buffer | Uint8Array;
        /** The format used to decode `wasmHash`, if it's provided as a string. */
        format?: "hex" | "base64";
      }
  ): Promise<AssembledTransaction<T>> {
    return ContractClient.deploy(null, options)
  }
  constructor(public readonly options: ContractClientOptions) {
    super(
      new ContractSpec([ "AAAAAAAAAd9VcGdyYWRlcyBhIHRhcmdldCBjb250cmFjdCB3aXRob3V0IGN1c3RvbSBtaWdyYXRpb24gZGF0YS4KCkNvbnZlbmllbmNlIHdyYXBwZXIgYXJvdW5kIFtgdXBncmFkZV9hbmRfbWlncmF0ZWBdKFNlbGY6OnVwZ3JhZGVfYW5kX21pZ3JhdGUpIHRoYXQKcGFzc2VzIGVtcHR5IG1pZ3JhdGlvbiBkYXRhIChYRFIgZW5jb2Rpbmcgb2YgYCgpYCkuIFVzZSBvbmx5IHdoZW4gdGhlIHRhcmdldOKAmXMKYE1pZ3JhdGlvbkRhdGFgIGlzIGAoKWAgb3IgaXQgc3VwcG9ydHMgZW1wdHkgbWlncmF0aW9uLgoKIyBBcmd1bWVudHMKKiBgY29udHJhY3RfYWRkcmVzc2AgLSBBZGRyZXNzIG9mIHRoZSBjb250cmFjdCB0byB1cGdyYWRlLgoqIGB3YXNtX2hhc2hgIC0gSGFzaCBvZiB0aGUgbmV3IFdBU00gYnl0ZWNvZGUuCiogYG9wZXJhdG9yYCAtIGBOb25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bnQAAA==",
        "AAAAAgAAAAAAAAAAAAAAElVwZ3JhZGVhYmxlU3RvcmFnZQAAAAAAAQAAAAAAAAAAAAAACU1pZ3JhdGluZwAAAA==" ]),
      options
    )
  }
  public readonly fromJSON = {
    upgrade: this.txFromJSON<null>,
        upgrade_and_migrate: this.txFromJSON<null>
  }
}