@symmio/trading-core 1.0.1 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. package/dist/core/config/create-config.d.ts +6 -3
  2. package/dist/core/config/create-config.d.ts.map +1 -1
  3. package/dist/core/config/create-config.js +1 -1
  4. package/dist/core/config/create-config.js.map +1 -1
  5. package/dist/index.d.ts +1 -1
  6. package/dist/index.d.ts.map +1 -1
  7. package/dist/index.js +279 -267
  8. package/dist/solvers/instant-close/instant-close-auto/instant-close-auto.d.ts +1 -1
  9. package/dist/solvers/instant-close/instant-close-auto/instant-close-auto.js.map +1 -1
  10. package/dist/solvers/instant-close/instant-close-bulk-auto/instant-close-bulk-auto.d.ts +2 -2
  11. package/dist/solvers/instant-close/instant-close-bulk-auto/instant-close-bulk-auto.js.map +1 -1
  12. package/dist/symmio-contracts/account-layer/actions/cancel-registration.d.ts +38 -0
  13. package/dist/symmio-contracts/account-layer/actions/cancel-registration.d.ts.map +1 -0
  14. package/dist/symmio-contracts/account-layer/actions/cancel-registration.js +26 -0
  15. package/dist/symmio-contracts/account-layer/actions/cancel-registration.js.map +1 -0
  16. package/dist/symmio-contracts/account-layer/actions/deposit-and-allocate-for-account.d.ts +4 -3
  17. package/dist/symmio-contracts/account-layer/actions/deposit-and-allocate-for-account.d.ts.map +1 -1
  18. package/dist/symmio-contracts/account-layer/actions/deposit-and-allocate-for-account.js.map +1 -1
  19. package/dist/symmio-contracts/account-layer/actions/deposit-for-account.d.ts +4 -3
  20. package/dist/symmio-contracts/account-layer/actions/deposit-for-account.d.ts.map +1 -1
  21. package/dist/symmio-contracts/account-layer/actions/deposit-for-account.js.map +1 -1
  22. package/dist/symmio-contracts/account-layer/actions/generate-account-manager-address.d.ts +39 -0
  23. package/dist/symmio-contracts/account-layer/actions/generate-account-manager-address.d.ts.map +1 -0
  24. package/dist/symmio-contracts/account-layer/actions/generate-account-manager-address.js +15 -0
  25. package/dist/symmio-contracts/account-layer/actions/generate-account-manager-address.js.map +1 -0
  26. package/dist/symmio-contracts/account-layer/actions/get-affiliate-state.d.ts +35 -0
  27. package/dist/symmio-contracts/account-layer/actions/get-affiliate-state.d.ts.map +1 -0
  28. package/dist/symmio-contracts/account-layer/actions/get-affiliate-state.js +15 -0
  29. package/dist/symmio-contracts/account-layer/actions/get-affiliate-state.js.map +1 -0
  30. package/dist/symmio-contracts/account-layer/actions/request-to-register-affiliate.d.ts +56 -0
  31. package/dist/symmio-contracts/account-layer/actions/request-to-register-affiliate.d.ts.map +1 -0
  32. package/dist/symmio-contracts/account-layer/actions/request-to-register-affiliate.js +26 -0
  33. package/dist/symmio-contracts/account-layer/actions/request-to-register-affiliate.js.map +1 -0
  34. package/dist/symmio-contracts/account-layer/actions/simulate-cancel-registration.d.ts +31 -0
  35. package/dist/symmio-contracts/account-layer/actions/simulate-cancel-registration.d.ts.map +1 -0
  36. package/dist/symmio-contracts/account-layer/actions/simulate-cancel-registration.js +16 -0
  37. package/dist/symmio-contracts/account-layer/actions/simulate-cancel-registration.js.map +1 -0
  38. package/dist/symmio-contracts/account-layer/actions/simulate-request-to-register-affiliate.d.ts +33 -0
  39. package/dist/symmio-contracts/account-layer/actions/simulate-request-to-register-affiliate.d.ts.map +1 -0
  40. package/dist/symmio-contracts/account-layer/actions/simulate-request-to-register-affiliate.js +16 -0
  41. package/dist/symmio-contracts/account-layer/actions/simulate-request-to-register-affiliate.js.map +1 -0
  42. package/dist/symmio-contracts/account-layer/index.d.ts +12 -0
  43. package/dist/symmio-contracts/account-layer/index.d.ts.map +1 -1
  44. package/dist/symmio-contracts/account-layer/query/cancel-registration.d.ts +22 -0
  45. package/dist/symmio-contracts/account-layer/query/cancel-registration.d.ts.map +1 -0
  46. package/dist/symmio-contracts/account-layer/query/cancel-registration.js +12 -0
  47. package/dist/symmio-contracts/account-layer/query/cancel-registration.js.map +1 -0
  48. package/dist/symmio-contracts/account-layer/query/generate-account-manager-address.d.ts +39 -0
  49. package/dist/symmio-contracts/account-layer/query/generate-account-manager-address.d.ts.map +1 -0
  50. package/dist/symmio-contracts/account-layer/query/generate-account-manager-address.js +30 -0
  51. package/dist/symmio-contracts/account-layer/query/generate-account-manager-address.js.map +1 -0
  52. package/dist/symmio-contracts/account-layer/query/get-affiliate-state.d.ts +38 -0
  53. package/dist/symmio-contracts/account-layer/query/get-affiliate-state.d.ts.map +1 -0
  54. package/dist/symmio-contracts/account-layer/query/get-affiliate-state.js +29 -0
  55. package/dist/symmio-contracts/account-layer/query/get-affiliate-state.js.map +1 -0
  56. package/dist/symmio-contracts/account-layer/query/request-to-register-affiliate.d.ts +22 -0
  57. package/dist/symmio-contracts/account-layer/query/request-to-register-affiliate.d.ts.map +1 -0
  58. package/dist/symmio-contracts/account-layer/query/request-to-register-affiliate.js +12 -0
  59. package/dist/symmio-contracts/account-layer/query/request-to-register-affiliate.js.map +1 -0
  60. package/dist/symmio-contracts/account-layer/query/simulate-cancel-registration.d.ts +19 -0
  61. package/dist/symmio-contracts/account-layer/query/simulate-cancel-registration.d.ts.map +1 -0
  62. package/dist/symmio-contracts/account-layer/query/simulate-cancel-registration.js +12 -0
  63. package/dist/symmio-contracts/account-layer/query/simulate-cancel-registration.js.map +1 -0
  64. package/dist/symmio-contracts/account-layer/query/simulate-request-to-register-affiliate.d.ts +19 -0
  65. package/dist/symmio-contracts/account-layer/query/simulate-request-to-register-affiliate.d.ts.map +1 -0
  66. package/dist/symmio-contracts/account-layer/query/simulate-request-to-register-affiliate.js +12 -0
  67. package/dist/symmio-contracts/account-layer/query/simulate-request-to-register-affiliate.js.map +1 -0
  68. package/dist/symmio-contracts/account-layer/types.d.ts +68 -0
  69. package/dist/symmio-contracts/account-layer/types.d.ts.map +1 -1
  70. package/dist/symmio-contracts/account-layer/types.js +3 -1
  71. package/dist/symmio-contracts/account-layer/types.js.map +1 -1
  72. package/package.json +1 -1
@@ -1,11 +1,14 @@
1
1
  export * from './actions/add-margin.js';
2
+ export * from './actions/cancel-registration.js';
2
3
  export * from './actions/create-sub-accounts.js';
3
4
  export * from './actions/delete-sub-account.js';
4
5
  export * from './actions/deposit-and-allocate-for-account.js';
5
6
  export * from './actions/deposit-for-account.js';
6
7
  export * from './actions/edit-account-name.js';
8
+ export * from './actions/generate-account-manager-address.js';
7
9
  export * from './actions/get-account-balance-info.js';
8
10
  export * from './actions/get-account-balance-of.js';
11
+ export * from './actions/get-affiliate-state.js';
9
12
  export * from './actions/get-sub-account.js';
10
13
  export * from './actions/get-sub-account-virtual-nonce.js';
11
14
  export * from './actions/get-sub-accounts-count-of-user.js';
@@ -15,21 +18,27 @@ export * from './actions/get-virtual-account.js';
15
18
  export * from './actions/get-virtual-accounts-addresses-of-sub-account.js';
16
19
  export * from './actions/predict-next-virtual-account.js';
17
20
  export * from './actions/remove-margin.js';
21
+ export * from './actions/request-to-register-affiliate.js';
18
22
  export * from './actions/simulate-add-margin.js';
23
+ export * from './actions/simulate-cancel-registration.js';
19
24
  export * from './actions/simulate-create-sub-accounts.js';
20
25
  export * from './actions/simulate-delete-sub-account.js';
21
26
  export * from './actions/simulate-deposit-and-allocate-for-account.js';
22
27
  export * from './actions/simulate-deposit-for-account.js';
23
28
  export * from './actions/simulate-edit-account-name.js';
24
29
  export * from './actions/simulate-remove-margin.js';
30
+ export * from './actions/simulate-request-to-register-affiliate.js';
25
31
  export * from './query/add-margin.js';
32
+ export * from './query/cancel-registration.js';
26
33
  export * from './query/create-sub-accounts.js';
27
34
  export * from './query/delete-sub-account.js';
28
35
  export * from './query/deposit-and-allocate-for-account.js';
29
36
  export * from './query/deposit-for-account.js';
30
37
  export * from './query/edit-account-name.js';
38
+ export * from './query/generate-account-manager-address.js';
31
39
  export * from './query/get-account-balance-info.js';
32
40
  export * from './query/get-account-balance-of.js';
41
+ export * from './query/get-affiliate-state.js';
33
42
  export * from './query/get-sub-account.js';
34
43
  export * from './query/get-sub-account-virtual-nonce.js';
35
44
  export * from './query/get-sub-accounts-count-of-user.js';
@@ -39,12 +48,15 @@ export * from './query/get-virtual-account.js';
39
48
  export * from './query/get-virtual-accounts-addresses-of-sub-account.js';
40
49
  export * from './query/predict-next-virtual-account.js';
41
50
  export * from './query/remove-margin.js';
51
+ export * from './query/request-to-register-affiliate.js';
42
52
  export * from './query/simulate-add-margin.js';
53
+ export * from './query/simulate-cancel-registration.js';
43
54
  export * from './query/simulate-create-sub-accounts.js';
44
55
  export * from './query/simulate-delete-sub-account.js';
45
56
  export * from './query/simulate-deposit-and-allocate-for-account.js';
46
57
  export * from './query/simulate-deposit-for-account.js';
47
58
  export * from './query/simulate-edit-account-name.js';
48
59
  export * from './query/simulate-remove-margin.js';
60
+ export * from './query/simulate-request-to-register-affiliate.js';
49
61
  export * from './types.js';
50
62
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/symmio-contracts/account-layer/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,4CAA4C,CAAC;AAC3D,cAAc,+BAA+B,CAAC;AAC9C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,oCAAoC,CAAC;AACnD,cAAc,kCAAkC,CAAC;AACjD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,yCAAyC,CAAC;AACxD,cAAc,0CAA0C,CAAC;AACzD,cAAc,iCAAiC,CAAC;AAChD,cAAc,2CAA2C,CAAC;AAC1D,cAAc,+BAA+B,CAAC;AAC9C,cAAc,yDAAyD,CAAC;AACxE,cAAc,wCAAwC,CAAC;AACvD,cAAc,yBAAyB,CAAC;AACxC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,wCAAwC,CAAC;AACvD,cAAc,uCAAuC,CAAC;AACtD,cAAc,qDAAqD,CAAC;AACpE,cAAc,wCAAwC,CAAC;AACvD,cAAc,sCAAsC,CAAC;AACrD,cAAc,kCAAkC,CAAC;AACj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from '../actions/cancel-registration.js';
3
+ /**
4
+ * Build TanStack Mutation options for {@link cancelRegistration}.
5
+ *
6
+ * The returned `mutationFn` takes the action's parameters and forwards them to
7
+ * `cancelRegistration(config, …)`. Framework layers compose `onSuccess`
8
+ * invalidation (e.g. of `getAffiliateState`) and error normalization on top.
9
+ *
10
+ * @param config - The SDK config (must have a `getWalletClient` resolver).
11
+ * @returns Options to pass to `useMutation`.
12
+ *
13
+ * @example
14
+ * ```ts
15
+ * useMutation(cancelRegistrationMutationOptions(config));
16
+ * ```
17
+ */
18
+ export declare function cancelRegistrationMutationOptions(config: Config): {
19
+ mutationKey: readonly ["cancelRegistration"];
20
+ mutationFn: (variables: CancelRegistrationParameters) => Promise<`0x${string}`>;
21
+ };
22
+ //# sourceMappingURL=cancel-registration.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cancel-registration.d.ts","sourceRoot":"","sources":["../../../../src/symmio-contracts/account-layer/query/cancel-registration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAsB,KAAK,4BAA4B,EAAE,MAAM,gCAAgC,CAAC;AAEvG;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,iCAAiC,CAAC,MAAM,EAAE,MAAM;;4BAGpC,4BAA4B;EAEvD"}
@@ -0,0 +1,12 @@
1
+ import { cancelRegistration as e } from "../actions/cancel-registration.js";
2
+ //#region src/symmio-contracts/account-layer/query/cancel-registration.ts
3
+ function t(t) {
4
+ return {
5
+ mutationKey: ["cancelRegistration"],
6
+ mutationFn: (n) => e(t, n)
7
+ };
8
+ }
9
+ //#endregion
10
+ export { t as cancelRegistrationMutationOptions };
11
+
12
+ //# sourceMappingURL=cancel-registration.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cancel-registration.js","names":[],"sources":["../../../../src/symmio-contracts/account-layer/query/cancel-registration.ts"],"sourcesContent":["import type { Config } from \"../../../core/config\";\nimport { cancelRegistration, type CancelRegistrationParameters } from \"../actions/cancel-registration\";\n\n/**\n * Build TanStack Mutation options for {@link cancelRegistration}.\n *\n * The returned `mutationFn` takes the action's parameters and forwards them to\n * `cancelRegistration(config, …)`. Framework layers compose `onSuccess`\n * invalidation (e.g. of `getAffiliateState`) and error normalization on top.\n *\n * @param config - The SDK config (must have a `getWalletClient` resolver).\n * @returns Options to pass to `useMutation`.\n *\n * @example\n * ```ts\n * useMutation(cancelRegistrationMutationOptions(config));\n * ```\n */\nexport function cancelRegistrationMutationOptions(config: Config) {\n return {\n mutationKey: [\"cancelRegistration\"] as const,\n mutationFn: (variables: CancelRegistrationParameters) => cancelRegistration(config, variables),\n };\n}\n"],"mappings":";;AAkBA,SAAgB,EAAkC,GAAgB;CAChE,OAAO;EACL,aAAa,CAAC,oBAAoB;EAClC,aAAa,MAA4C,EAAmB,GAAQ,CAAS;CAC/F;AACF"}
@@ -0,0 +1,39 @@
1
+ import { Config } from '../../../core/config/index.js';
2
+ import { Compute, ConfigKeyParameter, ExactPartial } from '../../../shared/types/properties.js';
3
+ import { QueryParameter, SymmioQueryOptions } from '../../../shared/types/query.js';
4
+ import { GenerateAccountManagerAddressParameters, GenerateAccountManagerAddressReturnType } from '../actions/generate-account-manager-address.js';
5
+ /** Data resolved by the {@link generateAccountManagerAddressQueryOptions} query. */
6
+ export type GenerateAccountManagerAddressData = GenerateAccountManagerAddressReturnType;
7
+ /**
8
+ * Build the TanStack Query key for {@link generateAccountManagerAddressQueryOptions}.
9
+ *
10
+ * @param options - Partial query parameters (chain id, registrant, name).
11
+ * @returns A stable, hashable query key.
12
+ */
13
+ export declare function generateAccountManagerAddressQueryKey(options?: Compute<ExactPartial<GenerateAccountManagerAddressParameters> & ConfigKeyParameter>): readonly ["generateAccountManagerAddress", Record<string, unknown>];
14
+ /** Query-key type produced by {@link generateAccountManagerAddressQueryKey}. */
15
+ export type GenerateAccountManagerAddressQueryKey = ReturnType<typeof generateAccountManagerAddressQueryKey>;
16
+ /**
17
+ * Options accepted by {@link generateAccountManagerAddressQueryOptions}: the
18
+ * action's parameters (all optional), an optional cache scope, and TanStack
19
+ * overrides.
20
+ */
21
+ export type GenerateAccountManagerAddressOptions = Compute<ExactPartial<GenerateAccountManagerAddressParameters> & QueryParameter<GenerateAccountManagerAddressData, Error, GenerateAccountManagerAddressData, GenerateAccountManagerAddressQueryKey>>;
22
+ /** TanStack Query options returned by {@link generateAccountManagerAddressQueryOptions}. */
23
+ export type GenerateAccountManagerAddressQueryOptions = SymmioQueryOptions<GenerateAccountManagerAddressData, Error, GenerateAccountManagerAddressData, GenerateAccountManagerAddressQueryKey>;
24
+ /**
25
+ * Build TanStack Query options for {@link generateAccountManagerAddress}. The
26
+ * query is disabled until both `registrant` and `name` are set. An unsupported
27
+ * chain surfaces a {@link SymmError} from the query function.
28
+ *
29
+ * @param config - The SDK config.
30
+ * @param options - Query parameters and TanStack overrides.
31
+ * @returns Options to pass to `useQuery` / `queryClient.fetchQuery`.
32
+ *
33
+ * @example
34
+ * ```ts
35
+ * useQuery(generateAccountManagerAddressQueryOptions(config, { registrant, name }));
36
+ * ```
37
+ */
38
+ export declare function generateAccountManagerAddressQueryOptions(config: Config, options?: GenerateAccountManagerAddressOptions): GenerateAccountManagerAddressQueryOptions;
39
+ //# sourceMappingURL=generate-account-manager-address.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generate-account-manager-address.d.ts","sourceRoot":"","sources":["../../../../src/symmio-contracts/account-layer/query/generate-account-manager-address.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAEnD,OAAO,KAAK,EAAE,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAClG,OAAO,KAAK,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAEtF,OAAO,EAEL,KAAK,uCAAuC,EAC5C,KAAK,uCAAuC,EAC7C,MAAM,6CAA6C,CAAC;AAErD,oFAAoF;AACpF,MAAM,MAAM,iCAAiC,GAAG,uCAAuC,CAAC;AAExF;;;;;GAKG;AACH,wBAAgB,qCAAqC,CACnD,OAAO,GAAE,OAAO,CAAC,YAAY,CAAC,uCAAuC,CAAC,GAAG,kBAAkB,CAAM,uEAGlG;AAED,gFAAgF;AAChF,MAAM,MAAM,qCAAqC,GAAG,UAAU,CAAC,OAAO,qCAAqC,CAAC,CAAC;AAE7G;;;;GAIG;AACH,MAAM,MAAM,oCAAoC,GAAG,OAAO,CACxD,YAAY,CAAC,uCAAuC,CAAC,GACnD,cAAc,CACZ,iCAAiC,EACjC,KAAK,EACL,iCAAiC,EACjC,qCAAqC,CACtC,CACJ,CAAC;AAEF,4FAA4F;AAC5F,MAAM,MAAM,yCAAyC,GAAG,kBAAkB,CACxE,iCAAiC,EACjC,KAAK,EACL,iCAAiC,EACjC,qCAAqC,CACtC,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,wBAAgB,yCAAyC,CACvD,MAAM,EAAE,MAAM,EACd,OAAO,GAAE,oCAAyC,GACjD,yCAAyC,CAoB3C"}
@@ -0,0 +1,30 @@
1
+ import { SymmError as e } from "../../../shared/errors/symm-error.js";
2
+ import { generateAccountManagerAddress as t } from "../actions/generate-account-manager-address.js";
3
+ import { filterQueryOptions as n } from "../../../shared/utils/query.js";
4
+ //#region src/symmio-contracts/account-layer/query/generate-account-manager-address.ts
5
+ function r(e = {}) {
6
+ return ["generateAccountManagerAddress", n(e)];
7
+ }
8
+ function i(n, i = {}) {
9
+ return {
10
+ ...i.query,
11
+ queryKey: r({
12
+ ...i,
13
+ configKey: n.getChainConfigKey(i.chainId)
14
+ }),
15
+ enabled: !!i.registrant && !!i.name && (i.query?.enabled ?? !0),
16
+ queryFn: () => {
17
+ let { chainId: r, registrant: a, name: o } = i;
18
+ if (!a || !o) throw new e("validation", "MISSING_PARAMS", "generateAccountManagerAddress: `registrant` and `name` are required.");
19
+ return t(n, {
20
+ chainId: r,
21
+ registrant: a,
22
+ name: o
23
+ });
24
+ }
25
+ };
26
+ }
27
+ //#endregion
28
+ export { r as generateAccountManagerAddressQueryKey, i as generateAccountManagerAddressQueryOptions };
29
+
30
+ //# sourceMappingURL=generate-account-manager-address.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generate-account-manager-address.js","names":[],"sources":["../../../../src/symmio-contracts/account-layer/query/generate-account-manager-address.ts"],"sourcesContent":["import type { Config } from \"../../../core/config\";\nimport { SymmError } from \"../../../shared/errors/symm-error\";\nimport type { Compute, ConfigKeyParameter, ExactPartial } from \"../../../shared/types/properties\";\nimport type { QueryParameter, SymmioQueryOptions } from \"../../../shared/types/query\";\nimport { filterQueryOptions } from \"../../../shared/utils/query\";\nimport {\n generateAccountManagerAddress,\n type GenerateAccountManagerAddressParameters,\n type GenerateAccountManagerAddressReturnType,\n} from \"../actions/generate-account-manager-address\";\n\n/** Data resolved by the {@link generateAccountManagerAddressQueryOptions} query. */\nexport type GenerateAccountManagerAddressData = GenerateAccountManagerAddressReturnType;\n\n/**\n * Build the TanStack Query key for {@link generateAccountManagerAddressQueryOptions}.\n *\n * @param options - Partial query parameters (chain id, registrant, name).\n * @returns A stable, hashable query key.\n */\nexport function generateAccountManagerAddressQueryKey(\n options: Compute<ExactPartial<GenerateAccountManagerAddressParameters> & ConfigKeyParameter> = {},\n) {\n return [\"generateAccountManagerAddress\", filterQueryOptions(options)] as const;\n}\n\n/** Query-key type produced by {@link generateAccountManagerAddressQueryKey}. */\nexport type GenerateAccountManagerAddressQueryKey = ReturnType<typeof generateAccountManagerAddressQueryKey>;\n\n/**\n * Options accepted by {@link generateAccountManagerAddressQueryOptions}: the\n * action's parameters (all optional), an optional cache scope, and TanStack\n * overrides.\n */\nexport type GenerateAccountManagerAddressOptions = Compute<\n ExactPartial<GenerateAccountManagerAddressParameters> &\n QueryParameter<\n GenerateAccountManagerAddressData,\n Error,\n GenerateAccountManagerAddressData,\n GenerateAccountManagerAddressQueryKey\n >\n>;\n\n/** TanStack Query options returned by {@link generateAccountManagerAddressQueryOptions}. */\nexport type GenerateAccountManagerAddressQueryOptions = SymmioQueryOptions<\n GenerateAccountManagerAddressData,\n Error,\n GenerateAccountManagerAddressData,\n GenerateAccountManagerAddressQueryKey\n>;\n\n/**\n * Build TanStack Query options for {@link generateAccountManagerAddress}. The\n * query is disabled until both `registrant` and `name` are set. An unsupported\n * chain surfaces a {@link SymmError} from the query function.\n *\n * @param config - The SDK config.\n * @param options - Query parameters and TanStack overrides.\n * @returns Options to pass to `useQuery` / `queryClient.fetchQuery`.\n *\n * @example\n * ```ts\n * useQuery(generateAccountManagerAddressQueryOptions(config, { registrant, name }));\n * ```\n */\nexport function generateAccountManagerAddressQueryOptions(\n config: Config,\n options: GenerateAccountManagerAddressOptions = {},\n): GenerateAccountManagerAddressQueryOptions {\n return {\n ...options.query,\n queryKey: generateAccountManagerAddressQueryKey({\n ...options,\n configKey: config.getChainConfigKey(options.chainId),\n }),\n enabled: Boolean(options.registrant) && Boolean(options.name) && (options.query?.enabled ?? true),\n queryFn: () => {\n const { chainId, registrant, name } = options;\n if (!registrant || !name) {\n throw new SymmError(\n \"validation\",\n \"MISSING_PARAMS\",\n \"generateAccountManagerAddress: `registrant` and `name` are required.\",\n );\n }\n return generateAccountManagerAddress(config, { chainId, registrant, name });\n },\n };\n}\n"],"mappings":";;;;AAoBA,SAAgB,EACd,IAA+F,CAAC,GAChG;CACA,OAAO,CAAC,iCAAiC,EAAmB,CAAO,CAAC;AACtE;AA0CA,SAAgB,EACd,GACA,IAAgD,CAAC,GACN;CAC3C,OAAO;EACL,GAAG,EAAQ;EACX,UAAU,EAAsC;GAC9C,GAAG;GACH,WAAW,EAAO,kBAAkB,EAAQ,OAAO;EACrD,CAAC;EACD,SAAS,EAAQ,EAAQ,cAAe,EAAQ,EAAQ,SAAU,EAAQ,OAAO,WAAW;EAC5F,eAAe;GACb,IAAM,EAAE,YAAS,eAAY,YAAS;GACtC,IAAI,CAAC,KAAc,CAAC,GAClB,MAAM,IAAI,EACR,cACA,kBACA,sEACF;GAEF,OAAO,EAA8B,GAAQ;IAAE;IAAS;IAAY;GAAK,CAAC;EAC5E;CACF;AACF"}
@@ -0,0 +1,38 @@
1
+ import { Config } from '../../../core/config/index.js';
2
+ import { Compute, ConfigKeyParameter, ExactPartial } from '../../../shared/types/properties.js';
3
+ import { QueryParameter, SymmioQueryOptions } from '../../../shared/types/query.js';
4
+ import { GetAffiliateStateParameters, GetAffiliateStateReturnType } from '../actions/get-affiliate-state.js';
5
+ /** Data resolved by the {@link getAffiliateStateQueryOptions} query. */
6
+ export type GetAffiliateStateData = GetAffiliateStateReturnType;
7
+ /**
8
+ * Build the TanStack Query key for {@link getAffiliateStateQueryOptions}.
9
+ *
10
+ * @param options - Partial query parameters (chain id, affiliate).
11
+ * @returns A stable, hashable query key.
12
+ */
13
+ export declare function getAffiliateStateQueryKey(options?: Compute<ExactPartial<GetAffiliateStateParameters> & ConfigKeyParameter>): readonly ["getAffiliateState", Record<string, unknown>];
14
+ /** Query-key type produced by {@link getAffiliateStateQueryKey}. */
15
+ export type GetAffiliateStateQueryKey = ReturnType<typeof getAffiliateStateQueryKey>;
16
+ /**
17
+ * Options accepted by {@link getAffiliateStateQueryOptions}: the action's
18
+ * parameters (all optional), an optional cache scope, and TanStack overrides.
19
+ */
20
+ export type GetAffiliateStateOptions = Compute<ExactPartial<GetAffiliateStateParameters> & QueryParameter<GetAffiliateStateData, Error, GetAffiliateStateData, GetAffiliateStateQueryKey>>;
21
+ /** TanStack Query options returned by {@link getAffiliateStateQueryOptions}. */
22
+ export type GetAffiliateStateQueryOptions = SymmioQueryOptions<GetAffiliateStateData, Error, GetAffiliateStateData, GetAffiliateStateQueryKey>;
23
+ /**
24
+ * Build TanStack Query options for {@link getAffiliateState}. The query is
25
+ * disabled until `affiliate` is set. An unsupported chain surfaces a
26
+ * {@link SymmError} from the query function (it is not silently disabled).
27
+ *
28
+ * @param config - The SDK config.
29
+ * @param options - Query parameters and TanStack overrides.
30
+ * @returns Options to pass to `useQuery` / `queryClient.fetchQuery`.
31
+ *
32
+ * @example
33
+ * ```ts
34
+ * useQuery(getAffiliateStateQueryOptions(config, { affiliate, chainId }));
35
+ * ```
36
+ */
37
+ export declare function getAffiliateStateQueryOptions(config: Config, options?: GetAffiliateStateOptions): GetAffiliateStateQueryOptions;
38
+ //# sourceMappingURL=get-affiliate-state.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-affiliate-state.d.ts","sourceRoot":"","sources":["../../../../src/symmio-contracts/account-layer/query/get-affiliate-state.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAEnD,OAAO,KAAK,EAAE,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAClG,OAAO,KAAK,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAEtF,OAAO,EAEL,KAAK,2BAA2B,EAChC,KAAK,2BAA2B,EACjC,MAAM,gCAAgC,CAAC;AAExC,wEAAwE;AACxE,MAAM,MAAM,qBAAqB,GAAG,2BAA2B,CAAC;AAEhE;;;;;GAKG;AACH,wBAAgB,yBAAyB,CACvC,OAAO,GAAE,OAAO,CAAC,YAAY,CAAC,2BAA2B,CAAC,GAAG,kBAAkB,CAAM,2DAGtF;AAED,oEAAoE;AACpE,MAAM,MAAM,yBAAyB,GAAG,UAAU,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAErF;;;GAGG;AACH,MAAM,MAAM,wBAAwB,GAAG,OAAO,CAC5C,YAAY,CAAC,2BAA2B,CAAC,GACvC,cAAc,CAAC,qBAAqB,EAAE,KAAK,EAAE,qBAAqB,EAAE,yBAAyB,CAAC,CACjG,CAAC;AAEF,gFAAgF;AAChF,MAAM,MAAM,6BAA6B,GAAG,kBAAkB,CAC5D,qBAAqB,EACrB,KAAK,EACL,qBAAqB,EACrB,yBAAyB,CAC1B,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,wBAAgB,6BAA6B,CAC3C,MAAM,EAAE,MAAM,EACd,OAAO,GAAE,wBAA6B,GACrC,6BAA6B,CAa/B"}
@@ -0,0 +1,29 @@
1
+ import { SymmError as e } from "../../../shared/errors/symm-error.js";
2
+ import { getAffiliateState as t } from "../actions/get-affiliate-state.js";
3
+ import { filterQueryOptions as n } from "../../../shared/utils/query.js";
4
+ //#region src/symmio-contracts/account-layer/query/get-affiliate-state.ts
5
+ function r(e = {}) {
6
+ return ["getAffiliateState", n(e)];
7
+ }
8
+ function i(n, i = {}) {
9
+ return {
10
+ ...i.query,
11
+ queryKey: r({
12
+ ...i,
13
+ configKey: n.getChainConfigKey(i.chainId)
14
+ }),
15
+ enabled: !!i.affiliate && (i.query?.enabled ?? !0),
16
+ queryFn: () => {
17
+ let { chainId: r, affiliate: a } = i;
18
+ if (!a) throw new e("validation", "MISSING_AFFILIATE", "getAffiliateState: `affiliate` is required.");
19
+ return t(n, {
20
+ chainId: r,
21
+ affiliate: a
22
+ });
23
+ }
24
+ };
25
+ }
26
+ //#endregion
27
+ export { r as getAffiliateStateQueryKey, i as getAffiliateStateQueryOptions };
28
+
29
+ //# sourceMappingURL=get-affiliate-state.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-affiliate-state.js","names":[],"sources":["../../../../src/symmio-contracts/account-layer/query/get-affiliate-state.ts"],"sourcesContent":["import type { Config } from \"../../../core/config\";\nimport { SymmError } from \"../../../shared/errors/symm-error\";\nimport type { Compute, ConfigKeyParameter, ExactPartial } from \"../../../shared/types/properties\";\nimport type { QueryParameter, SymmioQueryOptions } from \"../../../shared/types/query\";\nimport { filterQueryOptions } from \"../../../shared/utils/query\";\nimport {\n getAffiliateState,\n type GetAffiliateStateParameters,\n type GetAffiliateStateReturnType,\n} from \"../actions/get-affiliate-state\";\n\n/** Data resolved by the {@link getAffiliateStateQueryOptions} query. */\nexport type GetAffiliateStateData = GetAffiliateStateReturnType;\n\n/**\n * Build the TanStack Query key for {@link getAffiliateStateQueryOptions}.\n *\n * @param options - Partial query parameters (chain id, affiliate).\n * @returns A stable, hashable query key.\n */\nexport function getAffiliateStateQueryKey(\n options: Compute<ExactPartial<GetAffiliateStateParameters> & ConfigKeyParameter> = {},\n) {\n return [\"getAffiliateState\", filterQueryOptions(options)] as const;\n}\n\n/** Query-key type produced by {@link getAffiliateStateQueryKey}. */\nexport type GetAffiliateStateQueryKey = ReturnType<typeof getAffiliateStateQueryKey>;\n\n/**\n * Options accepted by {@link getAffiliateStateQueryOptions}: the action's\n * parameters (all optional), an optional cache scope, and TanStack overrides.\n */\nexport type GetAffiliateStateOptions = Compute<\n ExactPartial<GetAffiliateStateParameters> &\n QueryParameter<GetAffiliateStateData, Error, GetAffiliateStateData, GetAffiliateStateQueryKey>\n>;\n\n/** TanStack Query options returned by {@link getAffiliateStateQueryOptions}. */\nexport type GetAffiliateStateQueryOptions = SymmioQueryOptions<\n GetAffiliateStateData,\n Error,\n GetAffiliateStateData,\n GetAffiliateStateQueryKey\n>;\n\n/**\n * Build TanStack Query options for {@link getAffiliateState}. The query is\n * disabled until `affiliate` is set. An unsupported chain surfaces a\n * {@link SymmError} from the query function (it is not silently disabled).\n *\n * @param config - The SDK config.\n * @param options - Query parameters and TanStack overrides.\n * @returns Options to pass to `useQuery` / `queryClient.fetchQuery`.\n *\n * @example\n * ```ts\n * useQuery(getAffiliateStateQueryOptions(config, { affiliate, chainId }));\n * ```\n */\nexport function getAffiliateStateQueryOptions(\n config: Config,\n options: GetAffiliateStateOptions = {},\n): GetAffiliateStateQueryOptions {\n return {\n ...options.query,\n queryKey: getAffiliateStateQueryKey({ ...options, configKey: config.getChainConfigKey(options.chainId) }),\n enabled: Boolean(options.affiliate) && (options.query?.enabled ?? true),\n queryFn: () => {\n const { chainId, affiliate } = options;\n if (!affiliate) {\n throw new SymmError(\"validation\", \"MISSING_AFFILIATE\", \"getAffiliateState: `affiliate` is required.\");\n }\n return getAffiliateState(config, { chainId, affiliate });\n },\n };\n}\n"],"mappings":";;;;AAoBA,SAAgB,EACd,IAAmF,CAAC,GACpF;CACA,OAAO,CAAC,qBAAqB,EAAmB,CAAO,CAAC;AAC1D;AAoCA,SAAgB,EACd,GACA,IAAoC,CAAC,GACN;CAC/B,OAAO;EACL,GAAG,EAAQ;EACX,UAAU,EAA0B;GAAE,GAAG;GAAS,WAAW,EAAO,kBAAkB,EAAQ,OAAO;EAAE,CAAC;EACxG,SAAS,EAAQ,EAAQ,cAAe,EAAQ,OAAO,WAAW;EAClE,eAAe;GACb,IAAM,EAAE,YAAS,iBAAc;GAC/B,IAAI,CAAC,GACH,MAAM,IAAI,EAAU,cAAc,qBAAqB,6CAA6C;GAEtG,OAAO,EAAkB,GAAQ;IAAE;IAAS;GAAU,CAAC;EACzD;CACF;AACF"}
@@ -0,0 +1,22 @@
1
+ import { Config } from '../../../core/config/index.js';
2
+ import { RequestToRegisterAffiliateParameters } from '../actions/request-to-register-affiliate.js';
3
+ /**
4
+ * Build TanStack Mutation options for {@link requestToRegisterAffiliate}.
5
+ *
6
+ * The returned `mutationFn` takes the action's parameters and forwards them to
7
+ * `requestToRegisterAffiliate(config, …)`. Framework layers compose `onSuccess`
8
+ * invalidation (e.g. of `getAffiliateState`) and error normalization on top.
9
+ *
10
+ * @param config - The SDK config (must have a `getWalletClient` resolver).
11
+ * @returns Options to pass to `useMutation`.
12
+ *
13
+ * @example
14
+ * ```ts
15
+ * useMutation(requestToRegisterAffiliateMutationOptions(config));
16
+ * ```
17
+ */
18
+ export declare function requestToRegisterAffiliateMutationOptions(config: Config): {
19
+ mutationKey: readonly ["requestToRegisterAffiliate"];
20
+ mutationFn: (variables: RequestToRegisterAffiliateParameters) => Promise<`0x${string}`>;
21
+ };
22
+ //# sourceMappingURL=request-to-register-affiliate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"request-to-register-affiliate.d.ts","sourceRoot":"","sources":["../../../../src/symmio-contracts/account-layer/query/request-to-register-affiliate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAEL,KAAK,oCAAoC,EAC1C,MAAM,0CAA0C,CAAC;AAElD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,yCAAyC,CAAC,MAAM,EAAE,MAAM;;4BAG5C,oCAAoC;EAE/D"}
@@ -0,0 +1,12 @@
1
+ import { requestToRegisterAffiliate as e } from "../actions/request-to-register-affiliate.js";
2
+ //#region src/symmio-contracts/account-layer/query/request-to-register-affiliate.ts
3
+ function t(t) {
4
+ return {
5
+ mutationKey: ["requestToRegisterAffiliate"],
6
+ mutationFn: (n) => e(t, n)
7
+ };
8
+ }
9
+ //#endregion
10
+ export { t as requestToRegisterAffiliateMutationOptions };
11
+
12
+ //# sourceMappingURL=request-to-register-affiliate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"request-to-register-affiliate.js","names":[],"sources":["../../../../src/symmio-contracts/account-layer/query/request-to-register-affiliate.ts"],"sourcesContent":["import type { Config } from \"../../../core/config\";\nimport {\n requestToRegisterAffiliate,\n type RequestToRegisterAffiliateParameters,\n} from \"../actions/request-to-register-affiliate\";\n\n/**\n * Build TanStack Mutation options for {@link requestToRegisterAffiliate}.\n *\n * The returned `mutationFn` takes the action's parameters and forwards them to\n * `requestToRegisterAffiliate(config, …)`. Framework layers compose `onSuccess`\n * invalidation (e.g. of `getAffiliateState`) and error normalization on top.\n *\n * @param config - The SDK config (must have a `getWalletClient` resolver).\n * @returns Options to pass to `useMutation`.\n *\n * @example\n * ```ts\n * useMutation(requestToRegisterAffiliateMutationOptions(config));\n * ```\n */\nexport function requestToRegisterAffiliateMutationOptions(config: Config) {\n return {\n mutationKey: [\"requestToRegisterAffiliate\"] as const,\n mutationFn: (variables: RequestToRegisterAffiliateParameters) => requestToRegisterAffiliate(config, variables),\n };\n}\n"],"mappings":";;AAqBA,SAAgB,EAA0C,GAAgB;CACxE,OAAO;EACL,aAAa,CAAC,4BAA4B;EAC1C,aAAa,MAAoD,EAA2B,GAAQ,CAAS;CAC/G;AACF"}
@@ -0,0 +1,19 @@
1
+ import { Config } from '../../../core/config/index.js';
2
+ import { SimulateCancelRegistrationParameters } from '../actions/simulate-cancel-registration.js';
3
+ /**
4
+ * Build TanStack Mutation options for {@link simulateCancelRegistration} — an
5
+ * on-demand dry-run (`simulateContract`) of cancelRegistration.
6
+ *
7
+ * @param config - The SDK config.
8
+ * @returns Options to pass to `useMutation`.
9
+ *
10
+ * @example
11
+ * ```ts
12
+ * useMutation(simulateCancelRegistrationMutationOptions(config));
13
+ * ```
14
+ */
15
+ export declare function simulateCancelRegistrationMutationOptions(config: Config): {
16
+ mutationKey: readonly ["simulateCancelRegistration"];
17
+ mutationFn: (variables: SimulateCancelRegistrationParameters) => Promise<import('../index.js').SimulateCancelRegistrationReturnType>;
18
+ };
19
+ //# sourceMappingURL=simulate-cancel-registration.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"simulate-cancel-registration.d.ts","sourceRoot":"","sources":["../../../../src/symmio-contracts/account-layer/query/simulate-cancel-registration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAEL,KAAK,oCAAoC,EAC1C,MAAM,yCAAyC,CAAC;AAEjD;;;;;;;;;;;GAWG;AACH,wBAAgB,yCAAyC,CAAC,MAAM,EAAE,MAAM;;4BAG5C,oCAAoC;EAE/D"}
@@ -0,0 +1,12 @@
1
+ import { simulateCancelRegistration as e } from "../actions/simulate-cancel-registration.js";
2
+ //#region src/symmio-contracts/account-layer/query/simulate-cancel-registration.ts
3
+ function t(t) {
4
+ return {
5
+ mutationKey: ["simulateCancelRegistration"],
6
+ mutationFn: (n) => e(t, n)
7
+ };
8
+ }
9
+ //#endregion
10
+ export { t as simulateCancelRegistrationMutationOptions };
11
+
12
+ //# sourceMappingURL=simulate-cancel-registration.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"simulate-cancel-registration.js","names":[],"sources":["../../../../src/symmio-contracts/account-layer/query/simulate-cancel-registration.ts"],"sourcesContent":["import type { Config } from \"../../../core/config\";\nimport {\n simulateCancelRegistration,\n type SimulateCancelRegistrationParameters,\n} from \"../actions/simulate-cancel-registration\";\n\n/**\n * Build TanStack Mutation options for {@link simulateCancelRegistration} — an\n * on-demand dry-run (`simulateContract`) of cancelRegistration.\n *\n * @param config - The SDK config.\n * @returns Options to pass to `useMutation`.\n *\n * @example\n * ```ts\n * useMutation(simulateCancelRegistrationMutationOptions(config));\n * ```\n */\nexport function simulateCancelRegistrationMutationOptions(config: Config) {\n return {\n mutationKey: [\"simulateCancelRegistration\"] as const,\n mutationFn: (variables: SimulateCancelRegistrationParameters) => simulateCancelRegistration(config, variables),\n };\n}\n"],"mappings":";;AAkBA,SAAgB,EAA0C,GAAgB;CACxE,OAAO;EACL,aAAa,CAAC,4BAA4B;EAC1C,aAAa,MAAoD,EAA2B,GAAQ,CAAS;CAC/G;AACF"}
@@ -0,0 +1,19 @@
1
+ import { Config } from '../../../core/config/index.js';
2
+ import { SimulateRequestToRegisterAffiliateParameters } from '../actions/simulate-request-to-register-affiliate.js';
3
+ /**
4
+ * Build TanStack Mutation options for {@link simulateRequestToRegisterAffiliate} —
5
+ * an on-demand dry-run (`simulateContract`) of requestToRegisterAffiliate.
6
+ *
7
+ * @param config - The SDK config.
8
+ * @returns Options to pass to `useMutation`.
9
+ *
10
+ * @example
11
+ * ```ts
12
+ * useMutation(simulateRequestToRegisterAffiliateMutationOptions(config));
13
+ * ```
14
+ */
15
+ export declare function simulateRequestToRegisterAffiliateMutationOptions(config: Config): {
16
+ mutationKey: readonly ["simulateRequestToRegisterAffiliate"];
17
+ mutationFn: (variables: SimulateRequestToRegisterAffiliateParameters) => Promise<import('../index.js').SimulateRequestToRegisterAffiliateReturnType>;
18
+ };
19
+ //# sourceMappingURL=simulate-request-to-register-affiliate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"simulate-request-to-register-affiliate.d.ts","sourceRoot":"","sources":["../../../../src/symmio-contracts/account-layer/query/simulate-request-to-register-affiliate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAEL,KAAK,4CAA4C,EAClD,MAAM,mDAAmD,CAAC;AAE3D;;;;;;;;;;;GAWG;AACH,wBAAgB,iDAAiD,CAAC,MAAM,EAAE,MAAM;;4BAGpD,4CAA4C;EAGvE"}
@@ -0,0 +1,12 @@
1
+ import { simulateRequestToRegisterAffiliate as e } from "../actions/simulate-request-to-register-affiliate.js";
2
+ //#region src/symmio-contracts/account-layer/query/simulate-request-to-register-affiliate.ts
3
+ function t(t) {
4
+ return {
5
+ mutationKey: ["simulateRequestToRegisterAffiliate"],
6
+ mutationFn: (n) => e(t, n)
7
+ };
8
+ }
9
+ //#endregion
10
+ export { t as simulateRequestToRegisterAffiliateMutationOptions };
11
+
12
+ //# sourceMappingURL=simulate-request-to-register-affiliate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"simulate-request-to-register-affiliate.js","names":[],"sources":["../../../../src/symmio-contracts/account-layer/query/simulate-request-to-register-affiliate.ts"],"sourcesContent":["import type { Config } from \"../../../core/config\";\nimport {\n simulateRequestToRegisterAffiliate,\n type SimulateRequestToRegisterAffiliateParameters,\n} from \"../actions/simulate-request-to-register-affiliate\";\n\n/**\n * Build TanStack Mutation options for {@link simulateRequestToRegisterAffiliate} —\n * an on-demand dry-run (`simulateContract`) of requestToRegisterAffiliate.\n *\n * @param config - The SDK config.\n * @returns Options to pass to `useMutation`.\n *\n * @example\n * ```ts\n * useMutation(simulateRequestToRegisterAffiliateMutationOptions(config));\n * ```\n */\nexport function simulateRequestToRegisterAffiliateMutationOptions(config: Config) {\n return {\n mutationKey: [\"simulateRequestToRegisterAffiliate\"] as const,\n mutationFn: (variables: SimulateRequestToRegisterAffiliateParameters) =>\n simulateRequestToRegisterAffiliate(config, variables),\n };\n}\n"],"mappings":";;AAkBA,SAAgB,EAAkD,GAAgB;CAChF,OAAO;EACL,aAAa,CAAC,oCAAoC;EAClD,aAAa,MACX,EAAmC,GAAQ,CAAS;CACxD;AACF"}
@@ -181,4 +181,72 @@ export interface SubAccountCreationData {
181
181
  */
182
182
  singleVAMode: boolean;
183
183
  }
184
+ /**
185
+ * Lifecycle state of an affiliate on the `AccountLayer`.
186
+ *
187
+ * @remarks
188
+ * Names and ordering mirror the on-chain `enum AffiliateState` in
189
+ * `AffiliateStorage.sol` (perps-core v0.8.5) exactly, so a `uint8` returned by
190
+ * `getAffiliateState` casts directly to this enum without translation.
191
+ *
192
+ * @see {@link https://github.com/SYMM-IO/perps-core/blob/version_0.8.5/contracts/accountLayer/storages/AffiliateStorage.sol}
193
+ */
194
+ export declare enum AffiliateState {
195
+ /** No registration exists for this address. */
196
+ NONE = 0,
197
+ /** A registration request has been submitted and is awaiting approval. */
198
+ PENDING = 1,
199
+ /** The affiliate has been approved and can attribute trades and collect fees. */
200
+ ACTIVE = 2,
201
+ /** The affiliate has been paused by an approver; trading attribution is halted. */
202
+ PAUSED = 3
203
+ }
204
+ /**
205
+ * A single fee recipient within an affiliate registration, mirrored from the
206
+ * on-chain `Stakeholder` struct field-for-field (same order).
207
+ *
208
+ * @remarks
209
+ * `share` is scaled to `1e18`; the sum of every stakeholder's `share` plus the
210
+ * registration's `symmioShare` must equal exactly `1e18` or the contract reverts.
211
+ *
212
+ * @see {@link https://github.com/SYMM-IO/perps-core/blob/version_0.8.5/contracts/accountLayer/storages/AffiliateStorage.sol}
213
+ */
214
+ export interface Stakeholder {
215
+ /** Address that receives this stakeholder's cut of affiliate fees. */
216
+ receiver: Address;
217
+ /** This stakeholder's fee share, scaled to `1e18` (e.g. `0.4e18` for 40%). */
218
+ share: bigint;
219
+ }
220
+ /**
221
+ * The `AffiliateRegistration` tuple passed to {@link requestToRegisterAffiliate},
222
+ * mirrored from the on-chain struct field-for-field (same order) so the object
223
+ * encodes directly as the contract tuple without translation.
224
+ *
225
+ * @remarks
226
+ * The returned affiliate address is a **new, deterministic** `AccountManager`
227
+ * contract derived from `(msg.sender, name)` — not the caller's EOA. Predict it
228
+ * ahead of time with {@link generateAccountManagerAddress}. Registration only
229
+ * creates a `PENDING` affiliate; an `APPROVER_ROLE` holder must approve it before
230
+ * it becomes `ACTIVE`.
231
+ *
232
+ * @see {@link https://github.com/SYMM-IO/perps-core/blob/version_0.8.5/contracts/accountLayer/storages/AffiliateStorage.sol}
233
+ */
234
+ export interface AffiliateRegistration {
235
+ /** Display name for the affiliate. Validated on-chain to 1..maxNameLength characters. */
236
+ name: string;
237
+ /** UI brand color for the affiliate (free-form string, e.g. a hex color). */
238
+ brandColor: string;
239
+ /** The affiliate admin address. Must be non-zero; controls the affiliate after approval. */
240
+ admin: Address;
241
+ /** Fee recipients and their shares. Shares plus `symmioShare` must sum to `1e18`. */
242
+ stakeholders: Stakeholder[];
243
+ /** The Symmio protocol's fee share, scaled to `1e18`. With `stakeholders` shares, sums to `1e18`. */
244
+ symmioShare: bigint;
245
+ /** Free-form metadata blob. Pass `0x` when unused. */
246
+ metadata: Hex;
247
+ /** Legacy `MultiAccount` contracts to migrate into this affiliate. Pass `[]` when none. */
248
+ legacyMultiAccounts: Address[];
249
+ /** Symmio core (diamond) addresses to register the affiliate on. Each must be whitelisted. */
250
+ symmioCores: Address[];
251
+ }
184
252
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/symmio-contracts/account-layer/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;AAEzC;;;;;;;;;GASG;AACH,MAAM,WAAW,WAAW;IAC1B,2CAA2C;IAC3C,SAAS,EAAE,MAAM,CAAC;IAClB,gCAAgC;IAChC,KAAK,EAAE,OAAO,CAAC;IACf,8DAA8D;IAC9D,K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gCAAgC;IAChC,eAAe,EAAE,MAAM,CAAC;IACxB,gDAAgD;IAChD,qBAAqB,EAAE,MAAM,CAAC;IAC9B,gDAAgD;IAChD,qBAAqB,EAAE,MAAM,CAAC;CAC/B;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,sBAAsB;IACrC;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,QAAQ,EAAE,GAAG,CAAC;IACd;;;OAGG;IACH,UAAU,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,aAAa,EAAE,uBAAuB,CAAC;IACvC;;;;OAIG;IACH,YAAY,EAAE,OAAO,CAAC;CACvB"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/symmio-contracts/account-layer/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;AAEzC;;;;;;;;;GASG;AACH,MAAM,WAAW,WAAW;IAC1B,2CAA2C;IAC3C,SAAS,EAAE,MAAM,CAAC;IAClB,gCAAgC;IAChC,KAAK,EAAE,OAAO,CAAC;IACf,8DAA8D;IAC9D,KAAK,EAAE,OAAO,CAAC;CAChB;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,aAAa;IAC5B,sCAAsC;IACtC,KAAK,EAAE,GAAG,CAAC;IACX,uCAAuC;IACvC,SAAS,EAAE,MAAM,CAAC;IAClB,sEAAsE;IACtE,IAAI,EAAE,MAAM,CAAC;IACb,8DAA8D;IAC9D,gBAAgB,EAAE,GAAG,CAAC;IACtB,wCAAwC;IACxC,IAAI,EAAE,WAAW,CAAC;CACnB;AAED;;;;;;;;;;GAUG;AACH,oBAAY,uBAAuB;IACjC;;OAEG;IACH,QAAQ,IAAI;IACZ;;OAEG;IACH,MAAM,IAAI;IACV;;;OAGG;IACH,gBAAgB,IAAI;IACpB;;;OAGG;IACH,MAAM,IAAI;CACX;AAED;;;;;GAKG;AACH,MAAM,WAAW,gB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,iFAAiF;IACjF,MAAM,IAAI;IACV,mFAAmF;IACnF,MAAM,IAAI;CACX;AAED;;;;;;;;;GASG;AACH,MAAM,WAAW,WAAW;IAC1B,sEAAsE;IACtE,QAAQ,EAAE,OAAO,CAAC;IAClB,8EAA8E;IAC9E,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,qBAAqB;IACpC,yFAAyF;IACzF,IAAI,EAAE,MAAM,CAAC;IACb,6EAA6E;IAC7E,UAAU,EAAE,MAAM,CAAC;IACnB,4FAA4F;IAC5F,KAAK,EAAE,OAAO,CAAC;IACf,qFAAqF;IACrF,YAAY,EAAE,WAAW,EAAE,CAAC;IAC5B,qGAAqG;IACrG,WAAW,EAAE,MAAM,CAAC;IACpB,sDAAsD;IACtD,QAAQ,EAAE,GAAG,CAAC;IACd,2FAA2F;IAC3F,mBAAmB,EAAE,OAAO,EAAE,CAAC;IAC/B,8FAA8F;IAC9F,WAAW,EAAE,OAAO,EAAE,CAAC;CACxB"}
@@ -1,8 +1,10 @@
1
1
  //#region src/symmio-contracts/account-layer/types.ts
2
2
  var e = /* @__PURE__ */ function(e) {
3
3
  return e[e.POSITION = 0] = "POSITION", e[e.MARKET = 1] = "MARKET", e[e.MARKET_DIRECTION = 2] = "MARKET_DIRECTION", e[e.CUSTOM = 3] = "CUSTOM", e;
4
+ }({}), t = /* @__PURE__ */ function(e) {
5
+ return e[e.NONE = 0] = "NONE", e[e.PENDING = 1] = "PENDING", e[e.ACTIVE = 2] = "ACTIVE", e[e.PAUSED = 3] = "PAUSED", e;
4
6
  }({});
5
7
  //#endregion
6
- export { e as SubAccountIsolationType };
8
+ export { t as AffiliateState, e as SubAccountIsolationType };
7
9
 
8
10
  //# sourceMappingURL=types.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","names":[],"sources":["../../../src/symmio-contracts/account-layer/types.ts"],"sourcesContent":["import type { Address, Hex } from \"viem\";\n\n/**\n * A single Schnorr signature produced by the Muon network's TSS, mirrored from\n * the on-chain `ISymmio.SchnorrSign` struct field-for-field (same order).\n *\n * @remarks\n * Both `owner` and `nonce` are `address` on-chain (not numbers) — `nonce` is the\n * Muon nonce **address**, not a numeric nonce.\n *\n * @see {@link https://github.com/SYMM-IO/perps-core/blob/version_0.8.5/contracts/accountLayer/interfaces/ISymmio.sol}\n */\nexport interface SchnorrSign {\n /** Aggregated Schnorr signature scalar. */\n signature: bigint;\n /** Signer (gateway) address. */\n owner: Address;\n /** Muon nonce address (an `address`, not a numeric nonce). */\n nonce: Address;\n}\n\n/**\n * A Muon uPnL attestation, mirrored from the on-chain `ISymmio.SingleUpnlSig`\n * struct field-for-field (same order) so the object encodes directly as the\n * contract tuple without translation.\n *\n * @remarks\n * This is what {@link removeMargin} requires as its `upnlSig` argument: the\n * contract verifies it to prove the virtual account stays solvent after the\n * deallocation. Fetch a fresh one from the Muon service immediately before\n * submitting — the attestation is timestamped and short-lived. Note there is\n * **no** `price` field (this is the uPnL-only sig, not `SingleUpnlAndPriceSig`).\n *\n * @see {@link https://github.com/SYMM-IO/perps-core/blob/version_0.8.5/contracts/accountLayer/interfaces/ISymmio.sol}\n */\nexport interface SingleUpnlSig {\n /** Muon request id (opaque bytes). */\n reqId: Hex;\n /** Attestation timestamp (seconds). */\n timestamp: bigint;\n /** Signed unrealized PnL of the party, `int256` (may be negative). */\n upnl: bigint;\n /** Muon gateway signature over the request (opaque bytes). */\n gatewaySignature: Hex;\n /** The Schnorr TSS signature pieces. */\n sigs: SchnorrSign;\n}\n\n/**\n * Strategy the AccountLayer uses to create Virtual Accounts (VAs) for trades\n * placed through this subaccount.\n *\n * @remarks\n * Names and ordering mirror the on-chain `enum SubAccountIsolationType` in\n * `AccountStorage.sol` (perps-core v0.8.5) exactly, so a `uint8` returned by\n * `getUserSubAccounts` casts directly to this enum without translation.\n *\n * @see {@link https://github.com/SYMM-IO/perps-core/blob/version_0.8.5/contracts/accountLayer/storages/AccountStorage.sol}\n */\nexport enum SubAccountIsolationType {\n /**\n * One VA per trade. Each position lives in its own VA, fully isolated.\n */\n POSITION = 0,\n /**\n * One VA per market. All trades on the same market share a VA.\n */\n MARKET = 1,\n /**\n * One VA per market + direction. Longs and shorts on the same market are\n * isolated from each other.\n */\n MARKET_DIRECTION = 2,\n /**\n * No automatic VA creation. Trades execute on the SubAccount directly or on\n * manually-created VAs.\n */\n CUSTOM = 3,\n}\n\n/**\n * One subaccount owned by a user EOA on a SYMMIO `AccountLayer` deployment.\n *\n * Field shapes mirror the on-chain `SubAccountDetail` struct exactly so callers\n * comparing against raw viem decodings do not have to translate.\n */\nexport interface SubAccountDetail {\n /**\n * The subaccount's proxy address on-chain.\n */\n accountAddress: Address;\n /**\n * The EOA that created and owns the subaccount.\n */\n owner: Address;\n /**\n * User-defined display name. Editable via the `editAccountName` write.\n */\n name: string;\n /**\n * `false` for a subaccount that has been deleted on-chain.\n */\n isExists: boolean;\n /**\n * `true` when the subaccount routes successive quotes for the same market\n * into the existing active VA instead of creating a fresh VA per `sendQuote`.\n * Toggleable only while no VAs are active on the subaccount.\n */\n singleVAMode: boolean;\n /**\n * Affiliate address attributed to the subaccount, or the zero address.\n */\n affiliate: Address;\n /**\n * The Symmio core (diamond) address this subaccount trades against.\n */\n symmioCore: Address;\n /**\n * Free-form contract metadata blob. May be `0x` (empty) for most accounts.\n */\n metadata: Hex;\n /**\n * Strategy the AccountLayer uses to create VAs for this subaccount's trades.\n */\n isolationType: SubAccountIsolationType;\n}\n\n/**\n * Raw balance fields returned by `balanceInfoOfPartyA(account)` on a SYMMIO\n * core/diamond contract.\n *\n * Values are returned in the collateral token's raw units.\n */\nexport interface AccountBalanceInfo {\n /** Total allocated balance. */\n allocatedBalance: bigint;\n /** Locked CVA margin. */\n lockedCVA: bigint;\n /** Locked LF margin. */\n lockedLF: bigint;\n /** Locked PartyA maintenance margin. */\n lockedPartyAMM: bigint;\n /** Locked PartyB maintenance margin. */\n lockedPartyBMM: bigint;\n /** Pending locked CVA margin. */\n pendingLockedCVA: bigint;\n /** Pending locked LF margin. */\n pendingLockedLF: bigint;\n /** Pending locked PartyA maintenance margin. */\n pendingLockedPartyAMM: bigint;\n /** Pending locked PartyB maintenance margin. */\n pendingLockedPartyBMM: bigint;\n}\n\n/**\n * Input parameters for creating one subaccount via `createSubAccounts`.\n *\n * Field shapes and ordering mirror the on-chain `SubAccountCreationData` struct\n * in `AccountStorage.sol` (perps-core v0.8.5) exactly, so the object encodes\n * directly as the contract tuple without translation.\n *\n * @see {@link https://github.com/SYMM-IO/perps-core/blob/version_0.8.5/contracts/accountLayer/storages/AccountStorage.sol}\n */\nexport interface SubAccountCreationData {\n /**\n * Display name for the subaccount. Validated on-chain to 1-100 characters.\n */\n name: string;\n /**\n * Free-form metadata blob forwarded to the affiliate's `onAccountCreation`\n * hook. Pass `0x` when unused.\n */\n metadata: Hex;\n /**\n * The Symmio core (diamond) the subaccount trades against. Must be whitelisted\n * on the AccountLayer and registered for `affiliate`.\n */\n symmioCore: Address;\n /**\n * Strategy the AccountLayer uses to create VAs for this subaccount's trades.\n */\n isolationType: SubAccountIsolationType;\n /**\n * Route successive same-market quotes into the existing active VA instead of\n * creating a fresh VA per `sendQuote`. Only valid with `MARKET` or\n * `MARKET_DIRECTION` isolation; the contract reverts otherwise.\n */\n singleVAMode: boolean;\n}\n"],"mappings":";AA2DA,IAAY,IAAL,yBAAA,GAAA;QAIL,EAAA,EAAA,WAAA,KAAA,YAIA,EAAA,EAAA,SAAA,KAAA,UAKA,EAAA,EAAA,mBAAA,KAAA,oBAKA,EAAA,EAAA,SAAA,KAAA;AACF,EAAA,CAAA,CAAA"}
1
+ {"version":3,"file":"types.js","names":[],"sources":["../../../src/symmio-contracts/account-layer/types.ts"],"sourcesContent":["import type { Address, Hex } from \"viem\";\n\n/**\n * A single Schnorr signature produced by the Muon network's TSS, mirrored from\n * the on-chain `ISymmio.SchnorrSign` struct field-for-field (same order).\n *\n * @remarks\n * Both `owner` and `nonce` are `address` on-chain (not numbers) — `nonce` is the\n * Muon nonce **address**, not a numeric nonce.\n *\n * @see {@link https://github.com/SYMM-IO/perps-core/blob/version_0.8.5/contracts/accountLayer/interfaces/ISymmio.sol}\n */\nexport interface SchnorrSign {\n /** Aggregated Schnorr signature scalar. */\n signature: bigint;\n /** Signer (gateway) address. */\n owner: Address;\n /** Muon nonce address (an `address`, not a numeric nonce). */\n nonce: Address;\n}\n\n/**\n * A Muon uPnL attestation, mirrored from the on-chain `ISymmio.SingleUpnlSig`\n * struct field-for-field (same order) so the object encodes directly as the\n * contract tuple without translation.\n *\n * @remarks\n * This is what {@link removeMargin} requires as its `upnlSig` argument: the\n * contract verifies it to prove the virtual account stays solvent after the\n * deallocation. Fetch a fresh one from the Muon service immediately before\n * submitting — the attestation is timestamped and short-lived. Note there is\n * **no** `price` field (this is the uPnL-only sig, not `SingleUpnlAndPriceSig`).\n *\n * @see {@link https://github.com/SYMM-IO/perps-core/blob/version_0.8.5/contracts/accountLayer/interfaces/ISymmio.sol}\n */\nexport interface SingleUpnlSig {\n /** Muon request id (opaque bytes). */\n reqId: Hex;\n /** Attestation timestamp (seconds). */\n timestamp: bigint;\n /** Signed unrealized PnL of the party, `int256` (may be negative). */\n upnl: bigint;\n /** Muon gateway signature over the request (opaque bytes). */\n gatewaySignature: Hex;\n /** The Schnorr TSS signature pieces. */\n sigs: SchnorrSign;\n}\n\n/**\n * Strategy the AccountLayer uses to create Virtual Accounts (VAs) for trades\n * placed through this subaccount.\n *\n * @remarks\n * Names and ordering mirror the on-chain `enum SubAccountIsolationType` in\n * `AccountStorage.sol` (perps-core v0.8.5) exactly, so a `uint8` returned by\n * `getUserSubAccounts` casts directly to this enum without translation.\n *\n * @see {@link https://github.com/SYMM-IO/perps-core/blob/version_0.8.5/contracts/accountLayer/storages/AccountStorage.sol}\n */\nexport enum SubAccountIsolationType {\n /**\n * One VA per trade. Each position lives in its own VA, fully isolated.\n */\n POSITION = 0,\n /**\n * One VA per market. All trades on the same market share a VA.\n */\n MARKET = 1,\n /**\n * One VA per market + direction. Longs and shorts on the same market are\n * isolated from each other.\n */\n MARKET_DIRECTION = 2,\n /**\n * No automatic VA creation. Trades execute on the SubAccount directly or on\n * manually-created VAs.\n */\n CUSTOM = 3,\n}\n\n/**\n * One subaccount owned by a user EOA on a SYMMIO `AccountLayer` deployment.\n *\n * Field shapes mirror the on-chain `SubAccountDetail` struct exactly so callers\n * comparing against raw viem decodings do not have to translate.\n */\nexport interface SubAccountDetail {\n /**\n * The subaccount's proxy address on-chain.\n */\n accountAddress: Address;\n /**\n * The EOA that created and owns the subaccount.\n */\n owner: Address;\n /**\n * User-defined display name. Editable via the `editAccountName` write.\n */\n name: string;\n /**\n * `false` for a subaccount that has been deleted on-chain.\n */\n isExists: boolean;\n /**\n * `true` when the subaccount routes successive quotes for the same market\n * into the existing active VA instead of creating a fresh VA per `sendQuote`.\n * Toggleable only while no VAs are active on the subaccount.\n */\n singleVAMode: boolean;\n /**\n * Affiliate address attributed to the subaccount, or the zero address.\n */\n affiliate: Address;\n /**\n * The Symmio core (diamond) address this subaccount trades against.\n */\n symmioCore: Address;\n /**\n * Free-form contract metadata blob. May be `0x` (empty) for most accounts.\n */\n metadata: Hex;\n /**\n * Strategy the AccountLayer uses to create VAs for this subaccount's trades.\n */\n isolationType: SubAccountIsolationType;\n}\n\n/**\n * Raw balance fields returned by `balanceInfoOfPartyA(account)` on a SYMMIO\n * core/diamond contract.\n *\n * Values are returned in the collateral token's raw units.\n */\nexport interface AccountBalanceInfo {\n /** Total allocated balance. */\n allocatedBalance: bigint;\n /** Locked CVA margin. */\n lockedCVA: bigint;\n /** Locked LF margin. */\n lockedLF: bigint;\n /** Locked PartyA maintenance margin. */\n lockedPartyAMM: bigint;\n /** Locked PartyB maintenance margin. */\n lockedPartyBMM: bigint;\n /** Pending locked CVA margin. */\n pendingLockedCVA: bigint;\n /** Pending locked LF margin. */\n pendingLockedLF: bigint;\n /** Pending locked PartyA maintenance margin. */\n pendingLockedPartyAMM: bigint;\n /** Pending locked PartyB maintenance margin. */\n pendingLockedPartyBMM: bigint;\n}\n\n/**\n * Input parameters for creating one subaccount via `createSubAccounts`.\n *\n * Field shapes and ordering mirror the on-chain `SubAccountCreationData` struct\n * in `AccountStorage.sol` (perps-core v0.8.5) exactly, so the object encodes\n * directly as the contract tuple without translation.\n *\n * @see {@link https://github.com/SYMM-IO/perps-core/blob/version_0.8.5/contracts/accountLayer/storages/AccountStorage.sol}\n */\nexport interface SubAccountCreationData {\n /**\n * Display name for the subaccount. Validated on-chain to 1-100 characters.\n */\n name: string;\n /**\n * Free-form metadata blob forwarded to the affiliate's `onAccountCreation`\n * hook. Pass `0x` when unused.\n */\n metadata: Hex;\n /**\n * The Symmio core (diamond) the subaccount trades against. Must be whitelisted\n * on the AccountLayer and registered for `affiliate`.\n */\n symmioCore: Address;\n /**\n * Strategy the AccountLayer uses to create VAs for this subaccount's trades.\n */\n isolationType: SubAccountIsolationType;\n /**\n * Route successive same-market quotes into the existing active VA instead of\n * creating a fresh VA per `sendQuote`. Only valid with `MARKET` or\n * `MARKET_DIRECTION` isolation; the contract reverts otherwise.\n */\n singleVAMode: boolean;\n}\n\n/**\n * Lifecycle state of an affiliate on the `AccountLayer`.\n *\n * @remarks\n * Names and ordering mirror the on-chain `enum AffiliateState` in\n * `AffiliateStorage.sol` (perps-core v0.8.5) exactly, so a `uint8` returned by\n * `getAffiliateState` casts directly to this enum without translation.\n *\n * @see {@link https://github.com/SYMM-IO/perps-core/blob/version_0.8.5/contracts/accountLayer/storages/AffiliateStorage.sol}\n */\nexport enum AffiliateState {\n /** No registration exists for this address. */\n NONE = 0,\n /** A registration request has been submitted and is awaiting approval. */\n PENDING = 1,\n /** The affiliate has been approved and can attribute trades and collect fees. */\n ACTIVE = 2,\n /** The affiliate has been paused by an approver; trading attribution is halted. */\n PAUSED = 3,\n}\n\n/**\n * A single fee recipient within an affiliate registration, mirrored from the\n * on-chain `Stakeholder` struct field-for-field (same order).\n *\n * @remarks\n * `share` is scaled to `1e18`; the sum of every stakeholder's `share` plus the\n * registration's `symmioShare` must equal exactly `1e18` or the contract reverts.\n *\n * @see {@link https://github.com/SYMM-IO/perps-core/blob/version_0.8.5/contracts/accountLayer/storages/AffiliateStorage.sol}\n */\nexport interface Stakeholder {\n /** Address that receives this stakeholder's cut of affiliate fees. */\n receiver: Address;\n /** This stakeholder's fee share, scaled to `1e18` (e.g. `0.4e18` for 40%). */\n share: bigint;\n}\n\n/**\n * The `AffiliateRegistration` tuple passed to {@link requestToRegisterAffiliate},\n * mirrored from the on-chain struct field-for-field (same order) so the object\n * encodes directly as the contract tuple without translation.\n *\n * @remarks\n * The returned affiliate address is a **new, deterministic** `AccountManager`\n * contract derived from `(msg.sender, name)` — not the caller's EOA. Predict it\n * ahead of time with {@link generateAccountManagerAddress}. Registration only\n * creates a `PENDING` affiliate; an `APPROVER_ROLE` holder must approve it before\n * it becomes `ACTIVE`.\n *\n * @see {@link https://github.com/SYMM-IO/perps-core/blob/version_0.8.5/contracts/accountLayer/storages/AffiliateStorage.sol}\n */\nexport interface AffiliateRegistration {\n /** Display name for the affiliate. Validated on-chain to 1..maxNameLength characters. */\n name: string;\n /** UI brand color for the affiliate (free-form string, e.g. a hex color). */\n brandColor: string;\n /** The affiliate admin address. Must be non-zero; controls the affiliate after approval. */\n admin: Address;\n /** Fee recipients and their shares. Shares plus `symmioShare` must sum to `1e18`. */\n stakeholders: Stakeholder[];\n /** The Symmio protocol's fee share, scaled to `1e18`. With `stakeholders` shares, sums to `1e18`. */\n symmioShare: bigint;\n /** Free-form metadata blob. Pass `0x` when unused. */\n metadata: Hex;\n /** Legacy `MultiAccount` contracts to migrate into this affiliate. Pass `[]` when none. */\n legacyMultiAccounts: Address[];\n /** Symmio core (diamond) addresses to register the affiliate on. Each must be whitelisted. */\n symmioCores: Address[];\n}\n"],"mappings":";AA2DA,IAAY,IAAL,yBAAA,GAAA;QAIL,EAAA,EAAA,WAAA,KAAA,YAIA,EAAA,EAAA,SAAA,KAAA,UAKA,EAAA,EAAA,mBAAA,KAAA,oBAKA,EAAA,EAAA,SAAA,KAAA;AACF,EAAA,CAAA,CAAA,GA0HY,IAAL,yBAAA,GAAA;QAEL,EAAA,EAAA,OAAA,KAAA,QAEA,EAAA,EAAA,UAAA,KAAA,WAEA,EAAA,EAAA,SAAA,KAAA,UAEA,EAAA,EAAA,SAAA,KAAA;AACF,EAAA,CAAA,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@symmio/trading-core",
3
- "version": "1.0.1",
3
+ "version": "1.1.0",
4
4
  "description": "Framework-agnostic SYMMIO SDK. Contract calls, calculations, and transformations with no framework assumptions.",
5
5
  "license": "MIT",
6
6
  "homepage": "https://github.com/SYMM-IO/Trading-SDK/tree/main/packages/trading-core#readme",