@aboutcircles/sdk-types 0.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 (55) hide show
  1. package/dist/avatar.d.ts +102 -0
  2. package/dist/avatar.d.ts.map +1 -0
  3. package/dist/avatar.js +1 -0
  4. package/dist/base.d.ts +45 -0
  5. package/dist/base.d.ts.map +1 -0
  6. package/dist/base.js +1 -0
  7. package/dist/config.d.ts +34 -0
  8. package/dist/config.d.ts.map +1 -0
  9. package/dist/config.js +1 -0
  10. package/dist/contracts.d.ts +13 -0
  11. package/dist/contracts.d.ts.map +1 -0
  12. package/dist/contracts.js +5 -0
  13. package/dist/errors.d.ts +12 -0
  14. package/dist/errors.d.ts.map +1 -0
  15. package/dist/errors.js +1 -0
  16. package/dist/events.d.ts +23 -0
  17. package/dist/events.d.ts.map +1 -0
  18. package/dist/events.js +4 -0
  19. package/dist/group.d.ts +54 -0
  20. package/dist/group.d.ts.map +1 -0
  21. package/dist/group.js +1 -0
  22. package/dist/index.d.ts +24 -0
  23. package/dist/index.d.ts.map +1 -0
  24. package/dist/index.js +16 -0
  25. package/dist/network.d.ts +19 -0
  26. package/dist/network.d.ts.map +1 -0
  27. package/dist/network.js +1 -0
  28. package/dist/pathfinding.d.ts +84 -0
  29. package/dist/pathfinding.d.ts.map +1 -0
  30. package/dist/pathfinding.js +1 -0
  31. package/dist/query.d.ts +148 -0
  32. package/dist/query.d.ts.map +1 -0
  33. package/dist/query.js +4 -0
  34. package/dist/rpc.d.ts +42 -0
  35. package/dist/rpc.d.ts.map +1 -0
  36. package/dist/rpc.js +4 -0
  37. package/dist/runner.d.ts +64 -0
  38. package/dist/runner.d.ts.map +1 -0
  39. package/dist/runner.js +1 -0
  40. package/dist/sdk.d.ts +44 -0
  41. package/dist/sdk.d.ts.map +1 -0
  42. package/dist/sdk.js +8 -0
  43. package/dist/token.d.ts +49 -0
  44. package/dist/token.d.ts.map +1 -0
  45. package/dist/token.js +1 -0
  46. package/dist/transaction.d.ts +34 -0
  47. package/dist/transaction.d.ts.map +1 -0
  48. package/dist/transaction.js +1 -0
  49. package/dist/trust.d.ts +25 -0
  50. package/dist/trust.d.ts.map +1 -0
  51. package/dist/trust.js +1 -0
  52. package/dist/wrapper.d.ts +27 -0
  53. package/dist/wrapper.d.ts.map +1 -0
  54. package/dist/wrapper.js +12 -0
  55. package/package.json +34 -0
@@ -0,0 +1,102 @@
1
+ import type { Address } from './base';
2
+ /**
3
+ * Avatar and profile types
4
+ */
5
+ /**
6
+ * Avatar information
7
+ * Contains basic information about a Circles avatar.
8
+ */
9
+ export interface AvatarInfo {
10
+ /**
11
+ * The block number of the event
12
+ */
13
+ blockNumber: number;
14
+ /**
15
+ * The timestamp of the last change to the avatar
16
+ * Note: May be undefined for some avatars
17
+ */
18
+ timestamp?: number;
19
+ /**
20
+ * The transaction index
21
+ */
22
+ transactionIndex: number;
23
+ /**
24
+ * The log index
25
+ */
26
+ logIndex: number;
27
+ /**
28
+ * The hash of the transaction that last changed the avatar
29
+ */
30
+ transactionHash: string;
31
+ /**
32
+ * If the avatar is currently active in version 1 or 2
33
+ * Note: An avatar that's active in v2 can still have a v1 token. See `hasV1` and `v1Token`.
34
+ */
35
+ version: number;
36
+ /**
37
+ * The type of the avatar
38
+ */
39
+ type: 'CrcV2_RegisterHuman' | 'CrcV2_RegisterGroup' | 'CrcV2_RegisterOrganization' | 'CrcV1_Signup' | 'CrcV1_OrganizationSignup';
40
+ /**
41
+ * The address of the avatar
42
+ */
43
+ avatar: Address;
44
+ /**
45
+ * The personal or group token address (v1) or tokenId (v2)
46
+ * Note: v1 tokens are erc20 and have a token address. v2 tokens are erc1155 and have a tokenId.
47
+ * The v2 tokenId is always an encoded version of the avatar address.
48
+ */
49
+ tokenId?: string;
50
+ /**
51
+ * If the avatar is signed up at v1
52
+ */
53
+ hasV1: boolean;
54
+ /**
55
+ * If the avatar has a v1 token, this is the token address
56
+ */
57
+ v1Token?: Address;
58
+ /**
59
+ * The bytes of the avatar's metadata cidv0
60
+ */
61
+ cidV0Digest?: string;
62
+ /**
63
+ * The CIDv0 of the avatar's metadata (profile)
64
+ */
65
+ cidV0?: string;
66
+ /**
67
+ * If the avatar is stopped in v1
68
+ * Note: This is only set during Avatar initialization.
69
+ */
70
+ v1Stopped?: boolean;
71
+ /**
72
+ * Indicates whether the entity is a human
73
+ */
74
+ isHuman: boolean;
75
+ /**
76
+ * Groups have a name
77
+ */
78
+ name?: string;
79
+ /**
80
+ * Groups have a symbol
81
+ */
82
+ symbol?: string;
83
+ }
84
+ /**
85
+ * Profile information
86
+ */
87
+ export interface Profile {
88
+ name: string;
89
+ description?: string;
90
+ previewImageUrl?: string;
91
+ imageUrl?: string;
92
+ location?: string;
93
+ geoLocation?: [number, number];
94
+ extensions?: Record<string, any>;
95
+ }
96
+ /**
97
+ * Group profile with additional symbol field
98
+ */
99
+ export interface GroupProfile extends Profile {
100
+ symbol: string;
101
+ }
102
+ //# sourceMappingURL=avatar.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"avatar.d.ts","sourceRoot":"","sources":["../src/avatar.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAEtC;;GAEG;AAEH;;;GAGG;AACH,MAAM,WAAW,UAAU;IACzB;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,gBAAgB,EAAE,MAAM,CAAC;IACzB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,eAAe,EAAE,MAAM,CAAC;IACxB;;;OAGG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,IAAI,EACA,qBAAqB,GACrB,qBAAqB,GACrB,4BAA4B,GAC5B,cAAc,GACd,0BAA0B,CAAC;IAC/B;;OAEG;IACH,MAAM,EAAE,OAAO,CAAC;IAChB;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,KAAK,EAAE,OAAO,CAAC;IACf;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,OAAO,EAAE,OAAO,CAAC;IACjB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,OAAO;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/B,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAClC;AAED;;GAEG;AACH,MAAM,WAAW,YAAa,SAAQ,OAAO;IAC3C,MAAM,EAAE,MAAM,CAAC;CAChB"}
package/dist/avatar.js ADDED
@@ -0,0 +1 @@
1
+ export {};
package/dist/base.d.ts ADDED
@@ -0,0 +1,45 @@
1
+ import type { Abi, Address as ViemAddress } from 'abitype';
2
+ /**
3
+ * Base types for EVM interaction
4
+ */
5
+ /**
6
+ * Ethereum address type
7
+ */
8
+ export type Address = ViemAddress;
9
+ /**
10
+ * Hexadecimal string type
11
+ */
12
+ export type Hex = `0x${string}`;
13
+ /**
14
+ * Transaction or block hash type
15
+ */
16
+ export type Hash = `0x${string}`;
17
+ /**
18
+ * Generic contract configuration
19
+ */
20
+ export interface ContractConfig<TAbi extends Abi = Abi> {
21
+ address: Address;
22
+ abi: TAbi;
23
+ }
24
+ /**
25
+ * Transaction request object
26
+ * Contains all data needed to send a transaction
27
+ */
28
+ export interface TransactionRequest {
29
+ from?: Address;
30
+ to: Address;
31
+ data: Hex;
32
+ value?: bigint;
33
+ gas?: bigint;
34
+ gasPrice?: bigint;
35
+ nonce?: number;
36
+ }
37
+ /**
38
+ * Call result
39
+ */
40
+ export interface CallResult<T = unknown> {
41
+ success: boolean;
42
+ data?: T;
43
+ error?: Error;
44
+ }
45
+ //# sourceMappingURL=base.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../src/base.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,SAAS,CAAC;AAE3D;;GAEG;AAEH;;GAEG;AACH,MAAM,MAAM,OAAO,GAAG,WAAW,CAAC;AAElC;;GAEG;AACH,MAAM,MAAM,GAAG,GAAG,KAAK,MAAM,EAAE,CAAC;AAEhC;;GAEG;AACH,MAAM,MAAM,IAAI,GAAG,KAAK,MAAM,EAAE,CAAC;AAEjC;;GAEG;AACH,MAAM,WAAW,cAAc,CAAC,IAAI,SAAS,GAAG,GAAG,GAAG;IACpD,OAAO,EAAE,OAAO,CAAC;IACjB,GAAG,EAAE,IAAI,CAAC;CACX;AAED;;;GAGG;AACH,MAAM,WAAW,kBAAkB;IACjC,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,EAAE,EAAE,OAAO,CAAC;IACZ,IAAI,EAAE,GAAG,CAAC;IACV,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,UAAU,CAAC,CAAC,GAAG,OAAO;IACrC,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,CAAC,EAAE,CAAC,CAAC;IACT,KAAK,CAAC,EAAE,KAAK,CAAC;CACf"}
package/dist/base.js ADDED
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,34 @@
1
+ import type { Address } from './base';
2
+ /**
3
+ * Configuration types
4
+ */
5
+ /**
6
+ * Circles protocol configuration for a specific chain
7
+ */
8
+ export interface CirclesConfig {
9
+ /** RPC URL for Circles-specific endpoints */
10
+ circlesRpcUrl: string;
11
+ /** Pathfinder service URL for computing transfer paths */
12
+ pathfinderUrl: string;
13
+ /** Profile service URL for user profiles and metadata */
14
+ profileServiceUrl: string;
15
+ /** Circles V1 Hub contract address */
16
+ v1HubAddress: Address;
17
+ /** Circles V2 Hub contract address */
18
+ v2HubAddress: Address;
19
+ /** Name Registry contract address */
20
+ nameRegistryAddress: Address;
21
+ /** Base Group Mint Policy contract address */
22
+ baseGroupMintPolicy: Address;
23
+ /** Standard Treasury contract address */
24
+ standardTreasury: Address;
25
+ /** Core Members Group Deployer contract address */
26
+ coreMembersGroupDeployer: Address;
27
+ /** Base Group Factory contract address */
28
+ baseGroupFactoryAddress: Address;
29
+ /** Lift ERC20 contract address */
30
+ liftERC20Address: Address;
31
+ /** Invitation Escrow contract address */
32
+ invitationEscrowAddress: Address;
33
+ }
34
+ //# sourceMappingURL=config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAEtC;;GAEG;AAEH;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,6CAA6C;IAC7C,aAAa,EAAE,MAAM,CAAC;IACtB,0DAA0D;IAC1D,aAAa,EAAE,MAAM,CAAC;IACtB,yDAAyD;IACzD,iBAAiB,EAAE,MAAM,CAAC;IAC1B,sCAAsC;IACtC,YAAY,EAAE,OAAO,CAAC;IACtB,sCAAsC;IACtC,YAAY,EAAE,OAAO,CAAC;IACtB,qCAAqC;IACrC,mBAAmB,EAAE,OAAO,CAAC;IAC7B,8CAA8C;IAC9C,mBAAmB,EAAE,OAAO,CAAC;IAC7B,yCAAyC;IACzC,gBAAgB,EAAE,OAAO,CAAC;IAC1B,mDAAmD;IACnD,wBAAwB,EAAE,OAAO,CAAC;IAClC,0CAA0C;IAC1C,uBAAuB,EAAE,OAAO,CAAC;IACjC,kCAAkC;IAClC,gBAAgB,EAAE,OAAO,CAAC;IAC1B,yCAAyC;IACzC,uBAAuB,EAAE,OAAO,CAAC;CAClC"}
package/dist/config.js ADDED
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Contract types
3
+ * Types for contract-specific data structures and responses
4
+ */
5
+ /**
6
+ * Escrowed Amount and Days Result
7
+ * Returned by InvitationEscrow.getEscrowedAmountAndDays()
8
+ */
9
+ export interface EscrowedAmountAndDays {
10
+ escrowedAmount: bigint;
11
+ days_: bigint;
12
+ }
13
+ //# sourceMappingURL=contracts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contracts.d.ts","sourceRoot":"","sources":["../src/contracts.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;GAGG;AACH,MAAM,WAAW,qBAAqB;IACpC,cAAc,EAAE,MAAM,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;CACf"}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Contract types
3
+ * Types for contract-specific data structures and responses
4
+ */
5
+ export {};
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Decoded contract error information
3
+ * Contains parsed error data from failed contract transactions
4
+ */
5
+ export interface DecodedContractError {
6
+ errorName: string;
7
+ args?: any[];
8
+ selector: string;
9
+ rawData: string;
10
+ formattedMessage: string;
11
+ }
12
+ //# sourceMappingURL=errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,WAAW,oBAAoB;IACnC,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,gBAAgB,EAAE,MAAM,CAAC;CAC1B"}
package/dist/errors.js ADDED
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Events types
3
+ */
4
+ export type CirclesBaseEvent = {
5
+ blockNumber: number;
6
+ timestamp?: number;
7
+ transactionIndex: number;
8
+ logIndex: number;
9
+ transactionHash?: string;
10
+ };
11
+ export type CirclesEventType = 'CrcV2_ApprovalForAll' | 'CrcV2_DiscountCost' | 'CrcV2_FlowEdgesScopeLastEnded' | 'CrcV2_FlowEdgesScopeSingleStarted' | 'CrcV2_GroupMint' | 'CrcV2_PersonalMint' | 'CrcV2_RegisterGroup' | 'CrcV2_RegisterHuman' | 'CrcV2_RegisterOrganization' | 'CrcV2_SetAdvancedUsageFlag' | 'CrcV2_Stopped' | 'CrcV2_StreamCompleted' | 'CrcV2_TransferBatch' | 'CrcV2_TransferSingle' | 'CrcV2_Trust' | 'CrcV2_URI' | 'CrcV2_Approval' | 'CrcV2_DepositDemurraged' | 'CrcV2_DepositInflationary' | 'CrcV2_EIP712DomainChanged' | 'CrcV2_Transfer' | 'CrcV2_WithdrawDemurraged' | 'CrcV2_WithdrawInflationary' | 'CrcV2_CidV0' | 'CrcV2_RegisterShortName' | 'CrcV2_UpdateMetadataDigest' | 'CrcV2_GroupRedeemCollateralBurn' | 'CrcV2_GroupRedeemCollateralReturn' | 'CrcV2_InviteHuman' | 'Crc_UnknownEvent';
12
+ export type CirclesEvent = CirclesBaseEvent & {
13
+ $event: CirclesEventType;
14
+ [key: string]: any;
15
+ };
16
+ export type CirclesEventOfType<T extends CirclesEventType> = CirclesEvent & {
17
+ $event: T;
18
+ };
19
+ export type RpcSubscriptionEvent = {
20
+ event: string;
21
+ values: Record<string, any>;
22
+ };
23
+ //# sourceMappingURL=events.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../src/events.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,MAAM,gBAAgB,GAAG;IAC7B,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gBAAgB,EAAE,MAAM,CAAC;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAExB,sBAAsB,GACtB,oBAAoB,GACpB,+BAA+B,GAC/B,mCAAmC,GACnC,iBAAiB,GACjB,oBAAoB,GACpB,qBAAqB,GACrB,qBAAqB,GACrB,4BAA4B,GAC5B,4BAA4B,GAC5B,eAAe,GACf,uBAAuB,GACvB,qBAAqB,GACrB,sBAAsB,GACtB,aAAa,GACb,WAAW,GAEX,gBAAgB,GAChB,yBAAyB,GACzB,2BAA2B,GAC3B,2BAA2B,GAC3B,gBAAgB,GAChB,0BAA0B,GAC1B,4BAA4B,GAE5B,aAAa,GACb,yBAAyB,GACzB,4BAA4B,GAE5B,iCAAiC,GACjC,mCAAmC,GAEnC,mBAAmB,GAEnB,kBAAkB,CAAC;AAEvB,MAAM,MAAM,YAAY,GAAG,gBAAgB,GAAG;IAC5C,MAAM,EAAE,gBAAgB,CAAC;IACzB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,kBAAkB,CAAC,CAAC,SAAS,gBAAgB,IAAI,YAAY,GAAG;IAC1E,MAAM,EAAE,CAAC,CAAC;CACX,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAC7B,CAAC"}
package/dist/events.js ADDED
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Events types
3
+ */
4
+ export {};
@@ -0,0 +1,54 @@
1
+ import type { Address } from './base';
2
+ /**
3
+ * Group-related types
4
+ */
5
+ /**
6
+ * Group row information
7
+ */
8
+ export interface GroupRow {
9
+ blockNumber: number;
10
+ timestamp: number;
11
+ transactionIndex: number;
12
+ logIndex: number;
13
+ transactionHash: string;
14
+ group: Address;
15
+ type: string;
16
+ owner: Address;
17
+ mintPolicy?: Address;
18
+ mintHandler?: Address;
19
+ treasury?: Address;
20
+ service?: Address;
21
+ feeCollection?: Address;
22
+ memberCount?: number;
23
+ name?: string;
24
+ symbol?: string;
25
+ cidV0Digest?: string;
26
+ erc20WrapperDemurraged?: Address;
27
+ erc20WrapperStatic?: Address;
28
+ }
29
+ /**
30
+ * Group membership row
31
+ */
32
+ export interface GroupMembershipRow {
33
+ blockNumber: number;
34
+ timestamp: number;
35
+ transactionIndex: number;
36
+ logIndex: number;
37
+ transactionHash: string;
38
+ group: Address;
39
+ member: Address;
40
+ expiryTime: number;
41
+ }
42
+ /**
43
+ * Group query parameters
44
+ */
45
+ export interface GroupQueryParams {
46
+ nameStartsWith?: string;
47
+ symbolStartsWith?: string;
48
+ groupAddressIn?: Address[];
49
+ groupTypeIn?: string[];
50
+ ownerIn?: Address[];
51
+ mintHandlerEquals?: Address;
52
+ treasuryEquals?: Address;
53
+ }
54
+ //# sourceMappingURL=group.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"group.d.ts","sourceRoot":"","sources":["../src/group.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAEtC;;GAEG;AAEH;;GAEG;AACH,MAAM,WAAW,QAAQ;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,gBAAgB,EAAE,MAAM,CAAC;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,eAAe,EAAE,MAAM,CAAC;IACxB,KAAK,EAAE,OAAO,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,OAAO,CAAC;IACf,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC9B;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,gBAAgB,EAAE,MAAM,CAAC;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,eAAe,EAAE,MAAM,CAAC;IACxB,KAAK,EAAE,OAAO,CAAC;IACf,MAAM,EAAE,OAAO,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,cAAc,CAAC,EAAE,OAAO,EAAE,CAAC;IAC3B,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,OAAO,CAAC,EAAE,OAAO,EAAE,CAAC;IACpB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B"}
package/dist/group.js ADDED
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Circles SDK Types
3
+ *
4
+ * All types are organized by domain for better maintainability
5
+ */
6
+ export type { Address, Hex, Hash, ContractConfig, TransactionRequest, CallResult, } from './base';
7
+ export type { JsonRpcRequest, JsonRpcResponse, CirclesQueryResponse, QueryResponse } from './rpc';
8
+ export type { FilterType, ConjunctionType, FilterPredicate, Conjunction, Filter, SortOrder, OrderBy, QueryParams, TableInfo, EventRow, Cursor, PagedResult, PagedQueryParams, } from './query';
9
+ export type { AvatarInfo, Profile, GroupProfile } from './avatar';
10
+ export type { TokenBalance, TokenInfo, TokenHolder } from './token';
11
+ export type { TrustRelation, TrustRelationType, AggregatedTrustRelation } from './trust';
12
+ export type { GroupRow, GroupMembershipRow, GroupQueryParams } from './group';
13
+ export type { SimulatedBalance, FindPathParams, TransferStep, PathfindingResult, FlowEdgeStruct, StreamStruct, FlowMatrix, AdvancedTransferOptions, } from './pathfinding';
14
+ export type { EventType, NetworkSnapshot } from './network';
15
+ export type { CirclesConfig } from './config';
16
+ export { CirclesType } from './wrapper';
17
+ export type { WrappedTokenInfo, WrappedTokensRecord } from './wrapper';
18
+ export { GroupType } from './sdk';
19
+ export type { AvatarRow, TokenBalanceRow, TrustRelationRow, CirclesQuery } from './sdk';
20
+ export type { CirclesBaseEvent, CirclesEventType, CirclesEvent, CirclesEventOfType, RpcSubscriptionEvent } from './events';
21
+ export type { BatchRun, ContractRunner } from './runner';
22
+ export type { EscrowedAmountAndDays } from './contracts';
23
+ export type { DecodedContractError } from './errors';
24
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,YAAY,EACV,OAAO,EACP,GAAG,EACH,IAAI,EACJ,cAAc,EACd,kBAAkB,EAClB,UAAU,GACX,MAAM,QAAQ,CAAC;AAGhB,YAAY,EAAE,cAAc,EAAE,eAAe,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAGlG,YAAY,EACV,UAAU,EACV,eAAe,EACf,eAAe,EACf,WAAW,EACX,MAAM,EACN,SAAS,EACT,OAAO,EACP,WAAW,EACX,SAAS,EACT,QAAQ,EACR,MAAM,EACN,WAAW,EACX,gBAAgB,GACjB,MAAM,SAAS,CAAC;AAGjB,YAAY,EAAE,UAAU,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAGlE,YAAY,EAAE,YAAY,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAGpE,YAAY,EAAE,aAAa,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,MAAM,SAAS,CAAC;AAGzF,YAAY,EAAE,QAAQ,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAG9E,YAAY,EACV,gBAAgB,EAChB,cAAc,EACd,YAAY,EACZ,iBAAiB,EACjB,cAAc,EACd,YAAY,EACZ,UAAU,EACV,uBAAuB,GACxB,MAAM,eAAe,CAAC;AAGvB,YAAY,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAG5D,YAAY,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAG9C,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,YAAY,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAGvE,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClC,YAAY,EAAE,SAAS,EAAE,eAAe,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAGxF,YAAY,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,YAAY,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAI3H,YAAY,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAGzD,YAAY,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAGzD,YAAY,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,16 @@
1
+ // src/wrapper.ts
2
+ var CirclesType;
3
+ ((CirclesType2) => {
4
+ CirclesType2[CirclesType2["Demurrage"] = 0] = "Demurrage";
5
+ CirclesType2[CirclesType2["Inflation"] = 1] = "Inflation";
6
+ })(CirclesType ||= {});
7
+ // src/sdk.ts
8
+ var GroupType;
9
+ ((GroupType2) => {
10
+ GroupType2["Standard"] = "Standard";
11
+ GroupType2["Custom"] = "Custom";
12
+ })(GroupType ||= {});
13
+ export {
14
+ GroupType,
15
+ CirclesType
16
+ };
@@ -0,0 +1,19 @@
1
+ import type { TrustRelation } from './trust';
2
+ import type { TokenBalance } from './token';
3
+ /**
4
+ * Network and event types
5
+ */
6
+ /**
7
+ * Event types
8
+ */
9
+ export type EventType = 'CrcV1_Trust' | 'CrcV1_HubTransfer' | 'CrcV1_Signup' | 'CrcV1_OrganizationSignup' | 'CrcV2_RegisterHuman' | 'CrcV2_RegisterOrganization' | 'CrcV2_RegisterGroup' | 'CrcV2_Trust' | 'CrcV2_TransferSingle' | 'CrcV2_TransferBatch';
10
+ /**
11
+ * Network snapshot structure
12
+ */
13
+ export interface NetworkSnapshot {
14
+ trustRelations: TrustRelation[];
15
+ balances: TokenBalance[];
16
+ blockNumber: number;
17
+ timestamp: number;
18
+ }
19
+ //# sourceMappingURL=network.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"network.d.ts","sourceRoot":"","sources":["../src/network.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC7C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5C;;GAEG;AAEH;;GAEG;AACH,MAAM,MAAM,SAAS,GACjB,aAAa,GACb,mBAAmB,GACnB,cAAc,GACd,0BAA0B,GAC1B,qBAAqB,GACrB,4BAA4B,GAC5B,qBAAqB,GACrB,aAAa,GACb,sBAAsB,GACtB,qBAAqB,CAAC;AAE1B;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,cAAc,EAAE,aAAa,EAAE,CAAC;IAChC,QAAQ,EAAE,YAAY,EAAE,CAAC;IACzB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;CACnB"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,84 @@
1
+ import type { Address, Hex } from './base';
2
+ /**
3
+ * Pathfinding types
4
+ */
5
+ /**
6
+ * Simulated balance for path finding
7
+ */
8
+ export interface SimulatedBalance {
9
+ holder: Address;
10
+ token: Address;
11
+ amount: bigint;
12
+ isWrapped: boolean;
13
+ isStatic: boolean;
14
+ }
15
+ /**
16
+ * Path finding parameters for circlesV2_findPath
17
+ */
18
+ export interface FindPathParams {
19
+ from: Address;
20
+ to: Address;
21
+ targetFlow: bigint;
22
+ useWrappedBalances?: boolean;
23
+ fromTokens?: Address[];
24
+ toTokens?: Address[];
25
+ excludeFromTokens?: Address[];
26
+ excludeToTokens?: Address[];
27
+ simulatedBalances?: SimulatedBalance[];
28
+ maxTransfers?: number;
29
+ }
30
+ /**
31
+ * A single transfer step in a pathfinding result
32
+ */
33
+ export interface TransferStep {
34
+ from: Address;
35
+ to: Address;
36
+ tokenOwner: string;
37
+ value: bigint;
38
+ }
39
+ /**
40
+ * Result of pathfinding computation
41
+ */
42
+ export interface PathfindingResult {
43
+ maxFlow: bigint;
44
+ transfers: TransferStep[];
45
+ }
46
+ /**
47
+ * Flow edge structure for operateFlowMatrix
48
+ * Corresponds to TypeDefinitions.FlowEdge in the Hub V2 contract
49
+ */
50
+ export interface FlowEdgeStruct {
51
+ streamSinkId: number;
52
+ amount: bigint;
53
+ }
54
+ /**
55
+ * Stream structure for operateFlowMatrix
56
+ * Corresponds to TypeDefinitions.Stream in the Hub V2 contract
57
+ */
58
+ export interface StreamStruct {
59
+ sourceCoordinate: number;
60
+ flowEdgeIds: number[];
61
+ data: Uint8Array | Hex;
62
+ }
63
+ /**
64
+ * Flow matrix for ABI encoding
65
+ * Used with the operateFlowMatrix function in Hub V2
66
+ */
67
+ export interface FlowMatrix {
68
+ flowVertices: string[];
69
+ flowEdges: FlowEdgeStruct[];
70
+ streams: StreamStruct[];
71
+ packedCoordinates: string;
72
+ sourceCoordinate: number;
73
+ }
74
+ /**
75
+ * Advanced transfer options
76
+ * Extends FindPathParams to add transfer-specific options
77
+ */
78
+ export interface AdvancedTransferOptions extends Omit<FindPathParams, 'from' | 'to' | 'targetFlow'> {
79
+ /**
80
+ * Custom data to attach to the transfer (optional)
81
+ */
82
+ txData?: Uint8Array;
83
+ }
84
+ //# sourceMappingURL=pathfinding.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pathfinding.d.ts","sourceRoot":"","sources":["../src/pathfinding.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAC;AAE3C;;GAEG;AAEH;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,OAAO,CAAC;IAChB,KAAK,EAAE,OAAO,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,OAAO,CAAC;IACd,EAAE,EAAE,OAAO,CAAC;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,UAAU,CAAC,EAAE,OAAO,EAAE,CAAC;IACvB,QAAQ,CAAC,EAAE,OAAO,EAAE,CAAC;IACrB,iBAAiB,CAAC,EAAE,OAAO,EAAE,CAAC;IAC9B,eAAe,CAAC,EAAE,OAAO,EAAE,CAAC;IAC5B,iBAAiB,CAAC,EAAE,gBAAgB,EAAE,CAAC;IACvC,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,OAAO,CAAC;IACd,EAAE,EAAE,OAAO,CAAC;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,YAAY,EAAE,CAAC;CAC3B;AAED;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;;GAGG;AACH,MAAM,WAAW,YAAY;IAC3B,gBAAgB,EAAE,MAAM,CAAC;IACzB,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,IAAI,EAAE,UAAU,GAAG,GAAG,CAAC;CACxB;AAED;;;GAGG;AACH,MAAM,WAAW,UAAU;IACzB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,SAAS,EAAE,cAAc,EAAE,CAAC;IAC5B,OAAO,EAAE,YAAY,EAAE,CAAC;IACxB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,gBAAgB,EAAE,MAAM,CAAC;CAC1B;AAED;;;GAGG;AACH,MAAM,WAAW,uBAAwB,SAAQ,IAAI,CAAC,cAAc,EAAE,MAAM,GAAG,IAAI,GAAG,YAAY,CAAC;IACjG;;OAEG;IACH,MAAM,CAAC,EAAE,UAAU,CAAC;CACrB"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,148 @@
1
+ /**
2
+ * Query and filter types for circles_query RPC method
3
+ */
4
+ /**
5
+ * Filter types for query predicates
6
+ */
7
+ export type FilterType = 'Equals' | 'NotEquals' | 'GreaterThan' | 'LessThan' | 'GreaterOrEqualThan' | 'LessOrEqualThan' | 'Like';
8
+ /**
9
+ * Conjunction types for combining predicates
10
+ */
11
+ export type ConjunctionType = 'And' | 'Or';
12
+ /**
13
+ * Filter predicate for querying
14
+ */
15
+ export interface FilterPredicate {
16
+ Type: 'FilterPredicate';
17
+ FilterType: FilterType;
18
+ Column: string;
19
+ Value: string | number | boolean;
20
+ }
21
+ /**
22
+ * Conjunction for combining multiple predicates
23
+ */
24
+ export interface Conjunction {
25
+ Type: 'Conjunction';
26
+ ConjunctionType: ConjunctionType;
27
+ Predicates: (FilterPredicate | Conjunction)[];
28
+ }
29
+ /**
30
+ * Filter type (either a predicate or conjunction)
31
+ */
32
+ export type Filter = FilterPredicate | Conjunction;
33
+ /**
34
+ * Order direction for query results
35
+ */
36
+ export type SortOrder = 'ASC' | 'DESC';
37
+ /**
38
+ * Order by clause
39
+ */
40
+ export interface OrderBy {
41
+ Column: string;
42
+ SortOrder: SortOrder;
43
+ }
44
+ /**
45
+ * Query parameters for circles_query
46
+ */
47
+ export interface QueryParams {
48
+ Namespace: string;
49
+ Table: string;
50
+ Columns: string[];
51
+ Filter: Filter[];
52
+ Order: OrderBy[];
53
+ Limit?: number;
54
+ }
55
+ /**
56
+ * Table information from circles_tables
57
+ */
58
+ export interface TableInfo {
59
+ Namespace: string;
60
+ Table: string;
61
+ Columns: {
62
+ Name: string;
63
+ Type: string;
64
+ }[];
65
+ }
66
+ /**
67
+ * Pagination types
68
+ */
69
+ /**
70
+ * Defines the minimum columns any event row must have for cursor-based pagination.
71
+ * These values are important for determining cursor position in result sets.
72
+ */
73
+ export interface EventRow {
74
+ blockNumber: number;
75
+ transactionIndex: number;
76
+ logIndex: number;
77
+ batchIndex?: number;
78
+ timestamp?: number;
79
+ }
80
+ /**
81
+ * A cursor is a sortable unique identifier for a specific log entry.
82
+ * Used to paginate through query results efficiently.
83
+ */
84
+ export interface Cursor extends EventRow {
85
+ }
86
+ /**
87
+ * Result of a paginated query
88
+ */
89
+ export interface PagedResult<TRow extends EventRow> {
90
+ /**
91
+ * The number of results that were requested
92
+ */
93
+ limit: number;
94
+ /**
95
+ * The number of results that were returned
96
+ */
97
+ size: number;
98
+ /**
99
+ * If the query returned results, this will be the cursor for the first result
100
+ */
101
+ firstCursor?: Cursor;
102
+ /**
103
+ * If the query returned results, this will be the cursor for the last result
104
+ */
105
+ lastCursor?: Cursor;
106
+ /**
107
+ * The sort order of the results
108
+ */
109
+ sortOrder: SortOrder;
110
+ /**
111
+ * Whether there are more results available
112
+ */
113
+ hasMore: boolean;
114
+ /**
115
+ * The results of the query
116
+ */
117
+ results: TRow[];
118
+ }
119
+ /**
120
+ * Parameters for a paginated query
121
+ */
122
+ export interface PagedQueryParams {
123
+ /**
124
+ * The namespace of the table to query
125
+ */
126
+ namespace: string;
127
+ /**
128
+ * The name of the table to query
129
+ */
130
+ table: string;
131
+ /**
132
+ * The order to sort the results
133
+ */
134
+ sortOrder: SortOrder;
135
+ /**
136
+ * The columns to return in the results
137
+ */
138
+ columns: string[];
139
+ /**
140
+ * The filters to apply to the query
141
+ */
142
+ filter?: Filter[];
143
+ /**
144
+ * The number of results to return per page
145
+ */
146
+ limit: number;
147
+ }
148
+ //# sourceMappingURL=query.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../src/query.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;GAEG;AACH,MAAM,MAAM,UAAU,GAClB,QAAQ,GACR,WAAW,GACX,aAAa,GACb,UAAU,GACV,oBAAoB,GACpB,iBAAiB,GACjB,MAAM,CAAC;AAEX;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,KAAK,GAAG,IAAI,CAAC;AAE3C;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,iBAAiB,CAAC;IACxB,UAAU,EAAE,UAAU,CAAC;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;CAClC;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,aAAa,CAAC;IACpB,eAAe,EAAE,eAAe,CAAC;IACjC,UAAU,EAAE,CAAC,eAAe,GAAG,WAAW,CAAC,EAAE,CAAC;CAC/C;AAED;;GAEG;AACH,MAAM,MAAM,MAAM,GAAG,eAAe,GAAG,WAAW,CAAC;AAEnD;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,KAAK,GAAG,MAAM,CAAC;AAEvC;;GAEG;AACH,MAAM,WAAW,OAAO;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,SAAS,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,KAAK,EAAE,OAAO,EAAE,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE;QACP,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,MAAM,CAAC;KACd,EAAE,CAAC;CACL;AAED;;GAEG;AAEH;;;GAGG;AACH,MAAM,WAAW,QAAQ;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,gBAAgB,EAAE,MAAM,CAAC;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;GAGG;AACH,MAAM,WAAW,MAAO,SAAQ,QAAQ;CAAG;AAE3C;;GAEG;AACH,MAAM,WAAW,WAAW,CAAC,IAAI,SAAS,QAAQ;IAChD;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,SAAS,EAAE,SAAS,CAAC;IACrB;;OAEG;IACH,OAAO,EAAE,OAAO,CAAC;IACjB;;OAEG;IACH,OAAO,EAAE,IAAI,EAAE,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,SAAS,EAAE,SAAS,CAAC;IACrB;;OAEG;IACH,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;CACf"}
package/dist/query.js ADDED
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Query and filter types for circles_query RPC method
3
+ */
4
+ export {};
package/dist/rpc.d.ts ADDED
@@ -0,0 +1,42 @@
1
+ /**
2
+ * JSON-RPC types
3
+ */
4
+ /**
5
+ * JSON-RPC request structure
6
+ */
7
+ export interface JsonRpcRequest<TParams = unknown[]> {
8
+ jsonrpc: '2.0';
9
+ id: number | string;
10
+ method: string;
11
+ params: TParams;
12
+ }
13
+ /**
14
+ * JSON-RPC response structure
15
+ */
16
+ export interface JsonRpcResponse<TResult = unknown> {
17
+ jsonrpc: '2.0';
18
+ id: number | string;
19
+ result?: TResult;
20
+ error?: {
21
+ code: number;
22
+ message: string;
23
+ data?: unknown;
24
+ };
25
+ }
26
+ /**
27
+ * Circles query response format
28
+ * Used for circles_query RPC method results
29
+ */
30
+ export interface CirclesQueryResponse {
31
+ columns: string[];
32
+ rows: any[][];
33
+ }
34
+ /**
35
+ * Generic query response wrapper
36
+ * Used for internal query transformations and type-safe responses
37
+ */
38
+ export interface QueryResponse<T = unknown> {
39
+ result: T;
40
+ error?: unknown;
41
+ }
42
+ //# sourceMappingURL=rpc.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rpc.d.ts","sourceRoot":"","sources":["../src/rpc.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;GAEG;AACH,MAAM,WAAW,cAAc,CAAC,OAAO,GAAG,OAAO,EAAE;IACjD,OAAO,EAAE,KAAK,CAAC;IACf,EAAE,EAAE,MAAM,GAAG,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,OAAO,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,eAAe,CAAC,OAAO,GAAG,OAAO;IAChD,OAAO,EAAE,KAAK,CAAC;IACf,EAAE,EAAE,MAAM,GAAG,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE;QACN,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,EAAE,MAAM,CAAC;QAChB,IAAI,CAAC,EAAE,OAAO,CAAC;KAChB,CAAC;CACH;AAED;;;GAGG;AACH,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,IAAI,EAAE,GAAG,EAAE,EAAE,CAAC;CACf;AAED;;;GAGG;AACH,MAAM,WAAW,aAAa,CAAC,CAAC,GAAG,OAAO;IACxC,MAAM,EAAE,CAAC,CAAC;IACV,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB"}
package/dist/rpc.js ADDED
@@ -0,0 +1,4 @@
1
+ /**
2
+ * JSON-RPC types
3
+ */
4
+ export {};
@@ -0,0 +1,64 @@
1
+ import type { Address, TransactionRequest } from './base';
2
+ /**
3
+ * Runner types
4
+ * Core interfaces for contract execution and transaction handling
5
+ */
6
+ /**
7
+ * Batch transaction runner interface
8
+ * Allows multiple transactions to be batched and executed atomically
9
+ */
10
+ export interface BatchRun {
11
+ /**
12
+ * Add a transaction to the batch
13
+ */
14
+ addTransaction(tx: TransactionRequest): void;
15
+ /**
16
+ * Execute all batched transactions
17
+ * @returns Single transaction receipt for the entire batch
18
+ */
19
+ run(): Promise<any>;
20
+ }
21
+ /**
22
+ * Contract runner interface for executing blockchain operations
23
+ * This is the base interface that all contract runners must implement
24
+ */
25
+ export interface ContractRunner {
26
+ /**
27
+ * The address of the account (if available)
28
+ */
29
+ address?: Address;
30
+ /**
31
+ * The public client for reading blockchain state
32
+ */
33
+ publicClient: any;
34
+ /**
35
+ * Initialize the runner
36
+ */
37
+ init(): Promise<void>;
38
+ /**
39
+ * Estimate gas for a transaction
40
+ */
41
+ estimateGas?(tx: TransactionRequest): Promise<bigint>;
42
+ /**
43
+ * Call a contract (read-only)
44
+ */
45
+ call?(tx: TransactionRequest): Promise<string>;
46
+ /**
47
+ * Resolve an ENS name to an address
48
+ */
49
+ resolveName?(name: string): Promise<string | null>;
50
+ /**
51
+ * Send one or more transactions
52
+ * - Safe: batches all transactions atomically and returns single TransactionReceipt
53
+ */
54
+ sendTransaction?(txs: TransactionRequest[]): Promise<any>;
55
+ /**
56
+ * Create a batch transaction runner (if supported)
57
+ * This allows multiple transactions to be executed atomically in a single on-chain transaction
58
+ * Typically used with Safe multisig or other smart contract wallets
59
+ *
60
+ * @returns A BatchRun instance for adding transactions and executing them as a batch
61
+ */
62
+ sendBatchTransaction?(): BatchRun;
63
+ }
64
+ //# sourceMappingURL=runner.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runner.d.ts","sourceRoot":"","sources":["../src/runner.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,kBAAkB,EAAE,MAAM,QAAQ,CAAC;AAE1D;;;GAGG;AAEH;;;GAGG;AACH,MAAM,WAAW,QAAQ;IACvB;;OAEG;IACH,cAAc,CAAC,EAAE,EAAE,kBAAkB,GAAG,IAAI,CAAC;IAE7C;;;OAGG;IACH,GAAG,IAAI,OAAO,CAAC,GAAG,CAAC,CAAC;CACrB;AAED;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB;;OAEG;IACH,YAAY,EAAE,GAAG,CAAC;IAElB;;OAEG;IACH,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAEtB;;OAEG;IACH,WAAW,CAAC,CAAC,EAAE,EAAE,kBAAkB,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAEtD;;OAEG;IACH,IAAI,CAAC,CAAC,EAAE,EAAE,kBAAkB,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAE/C;;OAEG;IACH,WAAW,CAAC,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IAEnD;;;OAGG;IACH,eAAe,CAAC,CACd,GAAG,EAAE,kBAAkB,EAAE,GACxB,OAAO,CAAC,GAAG,CAAC,CAAC;IAEhB;;;;;;OAMG;IACH,oBAAoB,CAAC,IAAI,QAAQ,CAAC;CACnC"}
package/dist/runner.js ADDED
@@ -0,0 +1 @@
1
+ export {};
package/dist/sdk.d.ts ADDED
@@ -0,0 +1,44 @@
1
+ import type { Address } from './base';
2
+ /**
3
+ * SDK-related types
4
+ */
5
+ /**
6
+ * Avatar row data from RPC
7
+ */
8
+ export interface AvatarRow {
9
+ address: Address;
10
+ version: number;
11
+ type: string;
12
+ cidV0?: string;
13
+ }
14
+ /**
15
+ * Token balance row from RPC
16
+ */
17
+ export interface TokenBalanceRow {
18
+ tokenAddress: Address;
19
+ balance: bigint;
20
+ }
21
+ /**
22
+ * Trust relation row from RPC
23
+ */
24
+ export interface TrustRelationRow {
25
+ truster: Address;
26
+ trustee: Address;
27
+ expiryTime: number;
28
+ }
29
+ /**
30
+ * Circles query result with pagination
31
+ */
32
+ export interface CirclesQuery<T> {
33
+ rows: T[];
34
+ hasMore: boolean;
35
+ nextPage(): Promise<CirclesQuery<T>>;
36
+ }
37
+ /**
38
+ * Group type enumeration
39
+ */
40
+ export declare enum GroupType {
41
+ Standard = "Standard",
42
+ Custom = "Custom"
43
+ }
44
+ //# sourceMappingURL=sdk.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sdk.d.ts","sourceRoot":"","sources":["../src/sdk.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAEtC;;GAEG;AAEH;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;CAEhB;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,YAAY,EAAE,OAAO,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;CAEjB;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,YAAY,CAAC,CAAC;IAC7B,IAAI,EAAE,CAAC,EAAE,CAAC;IACV,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,IAAI,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC;CACtC;AAED;;GAEG;AACH,oBAAY,SAAS;IACnB,QAAQ,aAAa;IACrB,MAAM,WAAW;CAClB"}
package/dist/sdk.js ADDED
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Group type enumeration
3
+ */
4
+ export var GroupType;
5
+ (function (GroupType) {
6
+ GroupType["Standard"] = "Standard";
7
+ GroupType["Custom"] = "Custom";
8
+ })(GroupType || (GroupType = {}));
@@ -0,0 +1,49 @@
1
+ import type { Address } from './base';
2
+ /**
3
+ * Token-related types
4
+ */
5
+ /**
6
+ * Token balance information
7
+ */
8
+ export interface TokenBalance {
9
+ tokenAddress: Address;
10
+ tokenId: bigint;
11
+ tokenOwner: Address;
12
+ tokenType: string;
13
+ version: number;
14
+ attoCircles: bigint;
15
+ circles: number;
16
+ staticAttoCircles: bigint;
17
+ staticCircles: number;
18
+ attoCrc: bigint;
19
+ crc: number;
20
+ isErc20: boolean;
21
+ isErc1155: boolean;
22
+ isWrapped: boolean;
23
+ isInflationary: boolean;
24
+ isGroup: boolean;
25
+ }
26
+ /**
27
+ * Token information
28
+ */
29
+ export interface TokenInfo {
30
+ blockNumber: number;
31
+ timestamp: number;
32
+ transactionIndex: number;
33
+ logIndex: number;
34
+ transactionHash: string;
35
+ version: number;
36
+ type?: string;
37
+ tokenType: string;
38
+ token: Address;
39
+ tokenOwner: Address;
40
+ }
41
+ /**
42
+ * Token holder information from V_CrcV2_BalancesByAccountAndToken
43
+ */
44
+ export interface TokenHolder {
45
+ account: Address;
46
+ tokenAddress: Address;
47
+ demurragedTotalBalance: string;
48
+ }
49
+ //# sourceMappingURL=token.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"token.d.ts","sourceRoot":"","sources":["../src/token.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAEtC;;GAEG;AAEH;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,YAAY,EAAE,OAAO,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,OAAO,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,OAAO,CAAC;IACnB,SAAS,EAAE,OAAO,CAAC;IACnB,cAAc,EAAE,OAAO,CAAC;IACxB,OAAO,EAAE,OAAO,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,gBAAgB,EAAE,MAAM,CAAC;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,eAAe,EAAE,MAAM,CAAC;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,OAAO,CAAC;IACf,UAAU,EAAE,OAAO,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,OAAO,CAAC;IACjB,YAAY,EAAE,OAAO,CAAC;IACtB,sBAAsB,EAAE,MAAM,CAAC;CAChC"}
package/dist/token.js ADDED
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,34 @@
1
+ import type { Address } from './base';
2
+ /**
3
+ * Transaction history types
4
+ */
5
+ /**
6
+ * Transaction history row (base data from RPC)
7
+ * Might include conversions between different circle representations
8
+ */
9
+ export interface TransactionHistoryRow {
10
+ blockNumber: number;
11
+ timestamp: number;
12
+ transactionIndex: number;
13
+ logIndex: number;
14
+ transactionHash: string;
15
+ version: number;
16
+ from: Address;
17
+ to: Address;
18
+ id: string;
19
+ tokenAddress: Address;
20
+ value: string;
21
+ /** Human-readable circle amount (demurraged) */
22
+ circles?: number;
23
+ /** Atto-circles (demurraged, 18 decimals) */
24
+ attoCircles?: bigint;
25
+ /** Static circles (inflationary, human-readable) */
26
+ staticCircles?: number;
27
+ /** Atto-static circles (inflationary, 18 decimals) */
28
+ staticAttoCircles?: bigint;
29
+ /** Time Circles (CRC) human-readable */
30
+ crc?: number;
31
+ /** Atto-CRC (18 decimals) */
32
+ attoCrc?: bigint;
33
+ }
34
+ //# sourceMappingURL=transaction.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transaction.d.ts","sourceRoot":"","sources":["../src/transaction.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAEtC;;GAEG;AAEH;;;GAGG;AACH,MAAM,WAAW,qBAAqB;IACpC,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,gBAAgB,EAAE,MAAM,CAAC;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,eAAe,EAAE,MAAM,CAAC;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,OAAO,CAAC;IACd,EAAE,EAAE,OAAO,CAAC;IACZ,EAAE,EAAE,MAAM,CAAC;IACX,YAAY,EAAE,OAAO,CAAC;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,gDAAgD;IAChD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,6CAA6C;IAC7C,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,oDAAoD;IACpD,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,sDAAsD;IACtD,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,wCAAwC;IACxC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,6BAA6B;IAC7B,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,25 @@
1
+ import type { Address, Hex } from './base';
2
+ /**
3
+ * Trust relation types
4
+ */
5
+ /**
6
+ * Trust relation information
7
+ */
8
+ export interface TrustRelation {
9
+ blockNumber: number;
10
+ timestamp: number;
11
+ transactionIndex: number;
12
+ logIndex: number;
13
+ transactionHash: Hex;
14
+ truster: Address;
15
+ trustee: Address;
16
+ expiryTime: number;
17
+ }
18
+ export type TrustRelationType = 'trusts' | 'trustedBy' | 'mutuallyTrusts';
19
+ export interface AggregatedTrustRelation {
20
+ subjectAvatar: Address;
21
+ relation: TrustRelationType;
22
+ objectAvatar: Address;
23
+ timestamp: number;
24
+ }
25
+ //# sourceMappingURL=trust.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"trust.d.ts","sourceRoot":"","sources":["../src/trust.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAC;AAE3C;;GAEG;AAEH;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,gBAAgB,EAAE,MAAM,CAAC;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,eAAe,EAAE,GAAG,CAAC;IACrB,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,MAAM,iBAAiB,GAAG,QAAQ,GAAG,WAAW,GAAG,gBAAgB,CAAC;AAE1E,MAAM,WAAW,uBAAuB;IACtC,aAAa,EAAE,OAAO,CAAC;IACvB,QAAQ,EAAE,iBAAiB,CAAC;IAC5B,YAAY,EAAE,OAAO,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;CACnB"}
package/dist/trust.js ADDED
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Wrapper and Circles types
3
+ */
4
+ /**
5
+ * CirclesType enum
6
+ * Represents the type of Circles ERC20 wrapper
7
+ */
8
+ export declare enum CirclesType {
9
+ Demurrage = 0,
10
+ Inflation = 1
11
+ }
12
+ /**
13
+ * Information about a wrapped token found in a transfer path
14
+ * Maps wrapper address to [amount used in path, wrapper type]
15
+ */
16
+ export type WrappedTokenInfo = {
17
+ /** Amount of the wrapped token used in the path */
18
+ amount: bigint;
19
+ /** The type of wrapper (e.g., 'CrcV2_ERC20WrapperDeployed_Demurraged' or 'CrcV2_ERC20WrapperDeployed_Inflationary') */
20
+ tokenType: string;
21
+ };
22
+ /**
23
+ * Record of wrapped tokens found in a transfer path
24
+ * Maps wrapper address to wrapped token information
25
+ */
26
+ export type WrappedTokensRecord = Record<string, WrappedTokenInfo>;
27
+ //# sourceMappingURL=wrapper.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wrapper.d.ts","sourceRoot":"","sources":["../src/wrapper.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;GAGG;AACH,oBAAY,WAAW;IACrB,SAAS,IAAI;IACb,SAAS,IAAI;CACd;AAED;;;GAGG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B,mDAAmD;IACnD,MAAM,EAAE,MAAM,CAAC;IACf,uHAAuH;IACvH,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,mBAAmB,GAAG,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Wrapper and Circles types
3
+ */
4
+ /**
5
+ * CirclesType enum
6
+ * Represents the type of Circles ERC20 wrapper
7
+ */
8
+ export var CirclesType;
9
+ (function (CirclesType) {
10
+ CirclesType[CirclesType["Demurrage"] = 0] = "Demurrage";
11
+ CirclesType[CirclesType["Inflation"] = 1] = "Inflation";
12
+ })(CirclesType || (CirclesType = {}));
package/package.json ADDED
@@ -0,0 +1,34 @@
1
+ {
2
+ "name": "@aboutcircles/sdk-types",
3
+ "version": "0.1.0",
4
+ "description": "TypeScript type definitions for Circles SDK",
5
+ "type": "module",
6
+ "main": "./dist/index.js",
7
+ "types": "./dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/index.d.ts",
11
+ "default": "./dist/index.js"
12
+ }
13
+ },
14
+ "scripts": {
15
+ "build": "bun build ./src/index.ts --outdir ./dist --format esm --splitting && tsc --emitDeclarationOnly",
16
+ "dev": "tsc --build --watch",
17
+ "clean": "rm -rf dist tsconfig.tsbuildinfo"
18
+ },
19
+ "files": [
20
+ "dist"
21
+ ],
22
+ "keywords": [
23
+ "circles",
24
+ "types",
25
+ "typescript"
26
+ ],
27
+ "license": "MIT",
28
+ "dependencies": {
29
+ "abitype": "^1.1.1"
30
+ },
31
+ "devDependencies": {
32
+ "typescript": "^5.0.4"
33
+ }
34
+ }