@hashgraphonline/standards-sdk 0.1.143-feat-solana-register.canary.b3bfd5e.67 → 0.1.143-feat-solana-register.canary.4aacd87.68
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/hcs-10/sdk.d.ts +8 -0
- package/dist/cjs/hcs-10/sdk.d.ts.map +1 -1
- package/dist/cjs/hcs-15/browser.d.ts +2 -0
- package/dist/cjs/hcs-15/browser.d.ts.map +1 -1
- package/dist/cjs/hcs-15/sdk.d.ts +2 -0
- package/dist/cjs/hcs-15/sdk.d.ts.map +1 -1
- package/dist/cjs/hcs-15/tx.d.ts +4 -0
- package/dist/cjs/hcs-15/tx.d.ts.map +1 -1
- package/dist/cjs/hcs-16/tx.d.ts +9 -0
- package/dist/cjs/hcs-16/tx.d.ts.map +1 -1
- package/dist/cjs/standards-sdk.cjs +2 -2
- package/dist/cjs/standards-sdk.cjs.map +1 -1
- package/dist/cjs/utils/dynamic-import.d.ts.map +1 -1
- package/dist/es/hcs-10/sdk.d.ts +8 -0
- package/dist/es/hcs-10/sdk.d.ts.map +1 -1
- package/dist/es/hcs-15/browser.d.ts +2 -0
- package/dist/es/hcs-15/browser.d.ts.map +1 -1
- package/dist/es/hcs-15/sdk.d.ts +2 -0
- package/dist/es/hcs-15/sdk.d.ts.map +1 -1
- package/dist/es/hcs-15/tx.d.ts +4 -0
- package/dist/es/hcs-15/tx.d.ts.map +1 -1
- package/dist/es/hcs-16/tx.d.ts +9 -0
- package/dist/es/hcs-16/tx.d.ts.map +1 -1
- package/dist/es/standards-sdk.es.js +8 -2
- package/dist/es/standards-sdk.es110.js +1 -0
- package/dist/es/standards-sdk.es110.js.map +1 -1
- package/dist/es/standards-sdk.es150.js +2 -1
- package/dist/es/standards-sdk.es150.js.map +1 -1
- package/dist/es/standards-sdk.es17.js +1 -0
- package/dist/es/standards-sdk.es17.js.map +1 -1
- package/dist/es/standards-sdk.es19.js +18 -0
- package/dist/es/standards-sdk.es19.js.map +1 -1
- package/dist/es/standards-sdk.es20.js +1 -0
- package/dist/es/standards-sdk.es20.js.map +1 -1
- package/dist/es/standards-sdk.es28.js +1 -0
- package/dist/es/standards-sdk.es28.js.map +1 -1
- package/dist/es/standards-sdk.es36.js +1 -0
- package/dist/es/standards-sdk.es36.js.map +1 -1
- package/dist/es/standards-sdk.es61.js +1 -0
- package/dist/es/standards-sdk.es61.js.map +1 -1
- package/dist/es/standards-sdk.es78.js +1 -0
- package/dist/es/standards-sdk.es78.js.map +1 -1
- package/dist/es/standards-sdk.es87.js +22 -0
- package/dist/es/standards-sdk.es87.js.map +1 -1
- package/dist/es/standards-sdk.es88.js +4 -2
- package/dist/es/standards-sdk.es88.js.map +1 -1
- package/dist/es/standards-sdk.es89.js +4 -2
- package/dist/es/standards-sdk.es89.js.map +1 -1
- package/dist/es/standards-sdk.es92.js +70 -9
- package/dist/es/standards-sdk.es92.js.map +1 -1
- package/dist/es/utils/dynamic-import.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"standards-sdk.es88.js","sources":["../../src/hcs-15/sdk.ts"],"sourcesContent":["import {\n AccountId,\n Client,\n Hbar,\n PrivateKey,\n PublicKey,\n TransactionReceipt,\n} from '@hashgraph/sdk';\nimport { NetworkType } from '../utils/types';\nimport {\n createNodeOperatorContext,\n type NodeOperatorContext,\n} from '../common/node-operator-resolver';\nimport {\n buildHcs15BaseAccountCreateTx,\n buildHcs15PetalAccountCreateTx,\n} from './tx';\nimport type { SDKHCS15ClientConfig } from './types';\nimport { HCS15BaseClient } from './base-client';\n\nexport class HCS15Client extends HCS15BaseClient {\n private readonly operatorCtx: NodeOperatorContext;\n private readonly client: Client;\n private readonly operatorId: AccountId;\n\n constructor(config: SDKHCS15ClientConfig) {\n super(config);\n this.operatorId = AccountId.fromString(config.operatorId);\n this.operatorCtx = createNodeOperatorContext({\n network: this.network,\n operatorId: this.operatorId,\n operatorKey: config.operatorKey,\n keyType: config.keyType,\n mirrorNode: this.mirrorNode,\n logger: this.logger,\n client:\n this.network === 'mainnet' ? Client.forMainnet() : Client.forTestnet(),\n });\n this.client = this.operatorCtx.client;\n }\n\n public getKeyType(): 'ed25519' | 'ecdsa' {\n return this.operatorCtx.keyType;\n }\n\n public async close(): Promise<void> {\n try {\n this.client.close();\n } catch {}\n }\n\n /**\n * Create a new base account with a newly generated ECDSA key and EVM alias.\n */\n async createBaseAccount(options?: {\n initialBalance?: number;\n maxAutomaticTokenAssociations?: number;\n accountMemo?: string;\n }): Promise<{\n accountId: string;\n privateKey: PrivateKey;\n privateKeyHex: string;\n publicKey: PublicKey;\n evmAddress: string;\n receipt: TransactionReceipt;\n }> {\n const priv = PrivateKey.generateECDSA();\n const pub = priv.publicKey;\n const tx = buildHcs15BaseAccountCreateTx({\n publicKey: pub,\n initialBalance: new Hbar(options?.initialBalance ?? 10),\n maxAutomaticTokenAssociations: options?.maxAutomaticTokenAssociations,\n accountMemo: options?.accountMemo,\n });\n const resp = await tx.execute(this.client);\n const receipt = await resp.getReceipt(this.client);\n if (!receipt.accountId) {\n throw new Error('HCS-15 BASE_ACCOUNT_CREATE_FAILED');\n }\n const accountId = receipt.accountId.toString();\n const evmAddress = `0x${pub.toEvmAddress()}`;\n this.logger.info('Created HCS-15 base account', { accountId, evmAddress });\n return {\n accountId,\n privateKey: priv,\n privateKeyHex: priv.toStringRaw(),\n publicKey: pub,\n evmAddress,\n receipt,\n };\n }\n\n /**\n * Create a Petal account that reuses the base account ECDSA key (no alias).\n */\n async createPetalAccount(params: {\n basePrivateKey: string | PrivateKey;\n initialBalance?: number;\n maxAutomaticTokenAssociations?: number;\n accountMemo?: string;\n }): Promise<{ accountId: string; receipt: TransactionReceipt }> {\n const baseKey =\n typeof params.basePrivateKey === 'string'\n ? PrivateKey.fromStringECDSA(params.basePrivateKey)\n : params.basePrivateKey;\n const pub = baseKey.publicKey;\n const tx = buildHcs15PetalAccountCreateTx({\n publicKey: pub,\n initialBalance: new Hbar(params.initialBalance ?? 1),\n maxAutomaticTokenAssociations: params.maxAutomaticTokenAssociations,\n accountMemo: params.accountMemo,\n });\n const resp = await tx.execute(this.client);\n const receipt = await resp.getReceipt(this.client);\n if (!receipt.accountId) {\n throw new Error('HCS-15 PETAL_ACCOUNT_CREATE_FAILED');\n }\n const accountId = receipt.accountId.toString();\n this.logger.info('Created HCS-15 petal account', { accountId });\n return { accountId, receipt };\n }\n}\n"],"names":[],"mappings":";;;;AAoBO,MAAM,oBAAoB,gBAAgB;AAAA,EAK/C,YAAY,QAA8B;AACxC,UAAM,MAAM;AACZ,SAAK,aAAa,UAAU,WAAW,OAAO,UAAU;AACxD,SAAK,cAAc,0BAA0B;AAAA,MAC3C,SAAS,KAAK;AAAA,MACd,YAAY,KAAK;AAAA,MACjB,aAAa,OAAO;AAAA,MACpB,SAAS,OAAO;AAAA,MAChB,YAAY,KAAK;AAAA,MACjB,QAAQ,KAAK;AAAA,MACb,QACE,KAAK,YAAY,YAAY,OAAO,WAAA,IAAe,OAAO,WAAA;AAAA,IAAW,CACxE;AACD,SAAK,SAAS,KAAK,YAAY;AAAA,EACjC;AAAA,EAEO,aAAkC;AACvC,WAAO,KAAK,YAAY;AAAA,EAC1B;AAAA,EAEA,MAAa,QAAuB;AAClC,QAAI;AACF,WAAK,OAAO,MAAA;AAAA,IACd,QAAQ;AAAA,IAAC;AAAA,EACX;AAAA;AAAA;AAAA;AAAA,EAKA,MAAM,kBAAkB,
|
|
1
|
+
{"version":3,"file":"standards-sdk.es88.js","sources":["../../src/hcs-15/sdk.ts"],"sourcesContent":["import {\n AccountId,\n Client,\n Hbar,\n PrivateKey,\n PublicKey,\n TransactionReceipt,\n} from '@hashgraph/sdk';\nimport { NetworkType } from '../utils/types';\nimport {\n createNodeOperatorContext,\n type NodeOperatorContext,\n} from '../common/node-operator-resolver';\nimport {\n buildHcs15BaseAccountCreateTx,\n buildHcs15PetalAccountCreateTx,\n} from './tx';\nimport type { SDKHCS15ClientConfig } from './types';\nimport { HCS15BaseClient } from './base-client';\n\nexport class HCS15Client extends HCS15BaseClient {\n private readonly operatorCtx: NodeOperatorContext;\n private readonly client: Client;\n private readonly operatorId: AccountId;\n\n constructor(config: SDKHCS15ClientConfig) {\n super(config);\n this.operatorId = AccountId.fromString(config.operatorId);\n this.operatorCtx = createNodeOperatorContext({\n network: this.network,\n operatorId: this.operatorId,\n operatorKey: config.operatorKey,\n keyType: config.keyType,\n mirrorNode: this.mirrorNode,\n logger: this.logger,\n client:\n this.network === 'mainnet' ? Client.forMainnet() : Client.forTestnet(),\n });\n this.client = this.operatorCtx.client;\n }\n\n public getKeyType(): 'ed25519' | 'ecdsa' {\n return this.operatorCtx.keyType;\n }\n\n public async close(): Promise<void> {\n try {\n this.client.close();\n } catch {}\n }\n\n /**\n * Create a new base account with a newly generated ECDSA key and EVM alias.\n */\n async createBaseAccount(options?: {\n initialBalance?: number;\n maxAutomaticTokenAssociations?: number;\n accountMemo?: string;\n transactionMemo?: string;\n }): Promise<{\n accountId: string;\n privateKey: PrivateKey;\n privateKeyHex: string;\n publicKey: PublicKey;\n evmAddress: string;\n receipt: TransactionReceipt;\n }> {\n const priv = PrivateKey.generateECDSA();\n const pub = priv.publicKey;\n const tx = buildHcs15BaseAccountCreateTx({\n publicKey: pub,\n initialBalance: new Hbar(options?.initialBalance ?? 10),\n maxAutomaticTokenAssociations: options?.maxAutomaticTokenAssociations,\n accountMemo: options?.accountMemo,\n transactionMemo: options?.transactionMemo,\n });\n const resp = await tx.execute(this.client);\n const receipt = await resp.getReceipt(this.client);\n if (!receipt.accountId) {\n throw new Error('HCS-15 BASE_ACCOUNT_CREATE_FAILED');\n }\n const accountId = receipt.accountId.toString();\n const evmAddress = `0x${pub.toEvmAddress()}`;\n this.logger.info('Created HCS-15 base account', { accountId, evmAddress });\n return {\n accountId,\n privateKey: priv,\n privateKeyHex: priv.toStringRaw(),\n publicKey: pub,\n evmAddress,\n receipt,\n };\n }\n\n /**\n * Create a Petal account that reuses the base account ECDSA key (no alias).\n */\n async createPetalAccount(params: {\n basePrivateKey: string | PrivateKey;\n initialBalance?: number;\n maxAutomaticTokenAssociations?: number;\n accountMemo?: string;\n transactionMemo?: string;\n }): Promise<{ accountId: string; receipt: TransactionReceipt }> {\n const baseKey =\n typeof params.basePrivateKey === 'string'\n ? PrivateKey.fromStringECDSA(params.basePrivateKey)\n : params.basePrivateKey;\n const pub = baseKey.publicKey;\n const tx = buildHcs15PetalAccountCreateTx({\n publicKey: pub,\n initialBalance: new Hbar(params.initialBalance ?? 1),\n maxAutomaticTokenAssociations: params.maxAutomaticTokenAssociations,\n accountMemo: params.accountMemo,\n transactionMemo: params.transactionMemo,\n });\n const resp = await tx.execute(this.client);\n const receipt = await resp.getReceipt(this.client);\n if (!receipt.accountId) {\n throw new Error('HCS-15 PETAL_ACCOUNT_CREATE_FAILED');\n }\n const accountId = receipt.accountId.toString();\n this.logger.info('Created HCS-15 petal account', { accountId });\n return { accountId, receipt };\n }\n}\n"],"names":[],"mappings":";;;;AAoBO,MAAM,oBAAoB,gBAAgB;AAAA,EAK/C,YAAY,QAA8B;AACxC,UAAM,MAAM;AACZ,SAAK,aAAa,UAAU,WAAW,OAAO,UAAU;AACxD,SAAK,cAAc,0BAA0B;AAAA,MAC3C,SAAS,KAAK;AAAA,MACd,YAAY,KAAK;AAAA,MACjB,aAAa,OAAO;AAAA,MACpB,SAAS,OAAO;AAAA,MAChB,YAAY,KAAK;AAAA,MACjB,QAAQ,KAAK;AAAA,MACb,QACE,KAAK,YAAY,YAAY,OAAO,WAAA,IAAe,OAAO,WAAA;AAAA,IAAW,CACxE;AACD,SAAK,SAAS,KAAK,YAAY;AAAA,EACjC;AAAA,EAEO,aAAkC;AACvC,WAAO,KAAK,YAAY;AAAA,EAC1B;AAAA,EAEA,MAAa,QAAuB;AAClC,QAAI;AACF,WAAK,OAAO,MAAA;AAAA,IACd,QAAQ;AAAA,IAAC;AAAA,EACX;AAAA;AAAA;AAAA;A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,IACtD;AACA,UAAM,YAAY,QAAQ,UAAU,SAAA;AACpC,SAAK,OAAO,KAAK,gCAAgC,EAAE,WAAW;AAC9D,WAAO,EAAE,WAAW,QAAA;AAAA,EACtB;AACF;"}
|
|
@@ -23,7 +23,8 @@ class HCS15BrowserClient extends HCS15BaseClient {
|
|
|
23
23
|
publicKey: pub,
|
|
24
24
|
initialBalance: new Hbar(options?.initialBalance ?? 10),
|
|
25
25
|
maxAutomaticTokenAssociations: options?.maxAutomaticTokenAssociations,
|
|
26
|
-
accountMemo: options?.accountMemo
|
|
26
|
+
accountMemo: options?.accountMemo,
|
|
27
|
+
transactionMemo: options?.transactionMemo
|
|
27
28
|
});
|
|
28
29
|
const frozen = await tx.freezeWithSigner(signer);
|
|
29
30
|
const res = await frozen.executeWithSigner(signer);
|
|
@@ -52,7 +53,8 @@ class HCS15BrowserClient extends HCS15BaseClient {
|
|
|
52
53
|
publicKey: baseKey.publicKey,
|
|
53
54
|
initialBalance: new Hbar(params.initialBalance ?? 1),
|
|
54
55
|
maxAutomaticTokenAssociations: params.maxAutomaticTokenAssociations,
|
|
55
|
-
accountMemo: params.accountMemo
|
|
56
|
+
accountMemo: params.accountMemo,
|
|
57
|
+
transactionMemo: params.transactionMemo
|
|
56
58
|
});
|
|
57
59
|
const frozen = await tx.freezeWithSigner(signer);
|
|
58
60
|
const res = await frozen.executeWithSigner(signer);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"standards-sdk.es89.js","sources":["../../src/hcs-15/browser.ts"],"sourcesContent":["import type { DAppSigner } from '@hashgraph/hedera-wallet-connect';\nimport type {\n PublicKey,\n PrivateKey,\n TransactionResponse,\n} from '@hashgraph/sdk';\nimport { PrivateKey as SDKPrivateKey, Hbar } from '@hashgraph/sdk';\nimport type { BrowserHCS15ClientConfig } from './types';\n\nimport { HCS15BaseClient } from './base-client';\nimport {\n buildHcs15BaseAccountCreateTx,\n buildHcs15PetalAccountCreateTx,\n} from './tx';\n\nexport class HCS15BrowserClient extends HCS15BaseClient {\n private readonly signer?: DAppSigner;\n\n constructor(config: BrowserHCS15ClientConfig) {\n super(config);\n this.signer = config.signer || config.hwc?.dAppConnector?.signers?.[0];\n }\n\n private requireSigner(): DAppSigner {\n if (!this.signer) {\n throw new Error('HCS-15 Browser client requires an active DAppSigner');\n }\n return this.signer as DAppSigner;\n }\n\n /**\n * Create a new base account with a new ECDSA key and EVM alias using a connected wallet signer.\n */\n async createBaseAccount(options?: {\n initialBalance?: number;\n maxAutomaticTokenAssociations?: number;\n accountMemo?: string;\n }): Promise<{\n accountId?: string;\n privateKey: PrivateKey;\n privateKeyHex: string;\n publicKey: PublicKey;\n evmAddress: string;\n }> {\n const signer = this.requireSigner();\n const priv = SDKPrivateKey.generateECDSA();\n const pub = priv.publicKey;\n const tx = buildHcs15BaseAccountCreateTx({\n publicKey: pub,\n initialBalance: new Hbar(options?.initialBalance ?? 10),\n maxAutomaticTokenAssociations: options?.maxAutomaticTokenAssociations,\n accountMemo: options?.accountMemo,\n });\n const frozen = await tx.freezeWithSigner(signer);\n const res: TransactionResponse = await frozen.executeWithSigner(signer);\n const receipt = await res.getReceiptWithSigner(signer as any);\n const accountId = receipt?.accountId?.toString?.();\n const evmAddress = `0x${pub.toEvmAddress()}`;\n this.logger.info('Created HCS-15 base account (browser)', {\n accountId,\n evmAddress,\n });\n return {\n accountId,\n privateKey: priv,\n privateKeyHex: priv.toStringRaw(),\n publicKey: pub,\n evmAddress,\n };\n }\n\n /**\n * Create a petal account reusing a base ECDSA key, via wallet signer.\n */\n async createPetalAccount(params: {\n basePrivateKey: string | PrivateKey;\n initialBalance?: number;\n maxAutomaticTokenAssociations?: number;\n accountMemo?: string;\n }): Promise<{ accountId?: string }> {\n const signer = this.requireSigner();\n const baseKey =\n typeof params.basePrivateKey === 'string'\n ? SDKPrivateKey.fromStringECDSA(params.basePrivateKey)\n : params.basePrivateKey;\n const tx = buildHcs15PetalAccountCreateTx({\n publicKey: baseKey.publicKey,\n initialBalance: new Hbar(params.initialBalance ?? 1),\n maxAutomaticTokenAssociations: params.maxAutomaticTokenAssociations,\n accountMemo: params.accountMemo,\n });\n const frozen = await tx.freezeWithSigner(signer);\n const res: TransactionResponse = await frozen.executeWithSigner(signer);\n const receipt = await res.getReceiptWithSigner(signer as any);\n const accountId = receipt?.accountId?.toString?.();\n this.logger.info('Created HCS-15 petal account (browser)', { accountId });\n return { accountId };\n }\n}\n"],"names":["SDKPrivateKey"],"mappings":";;;AAeO,MAAM,2BAA2B,gBAAgB;AAAA,EAGtD,YAAY,QAAkC;AAC5C,UAAM,MAAM;AACZ,SAAK,SAAS,OAAO,UAAU,OAAO,KAAK,eAAe,UAAU,CAAC;AAAA,EACvE;AAAA,EAEQ,gBAA4B;AAClC,QAAI,CAAC,KAAK,QAAQ;AAChB,YAAM,IAAI,MAAM,qDAAqD;AAAA,IACvE;AACA,WAAO,KAAK;AAAA,EACd;AAAA;AAAA;AAAA;AAAA,EAKA,MAAM,kBAAkB,
|
|
1
|
+
{"version":3,"file":"standards-sdk.es89.js","sources":["../../src/hcs-15/browser.ts"],"sourcesContent":["import type { DAppSigner } from '@hashgraph/hedera-wallet-connect';\nimport type {\n PublicKey,\n PrivateKey,\n TransactionResponse,\n} from '@hashgraph/sdk';\nimport { PrivateKey as SDKPrivateKey, Hbar } from '@hashgraph/sdk';\nimport type { BrowserHCS15ClientConfig } from './types';\n\nimport { HCS15BaseClient } from './base-client';\nimport {\n buildHcs15BaseAccountCreateTx,\n buildHcs15PetalAccountCreateTx,\n} from './tx';\n\nexport class HCS15BrowserClient extends HCS15BaseClient {\n private readonly signer?: DAppSigner;\n\n constructor(config: BrowserHCS15ClientConfig) {\n super(config);\n this.signer = config.signer || config.hwc?.dAppConnector?.signers?.[0];\n }\n\n private requireSigner(): DAppSigner {\n if (!this.signer) {\n throw new Error('HCS-15 Browser client requires an active DAppSigner');\n }\n return this.signer as DAppSigner;\n }\n\n /**\n * Create a new base account with a new ECDSA key and EVM alias using a connected wallet signer.\n */\n async createBaseAccount(options?: {\n initialBalance?: number;\n maxAutomaticTokenAssociations?: number;\n accountMemo?: string;\n transactionMemo?: string;\n }): Promise<{\n accountId?: string;\n privateKey: PrivateKey;\n privateKeyHex: string;\n publicKey: PublicKey;\n evmAddress: string;\n }> {\n const signer = this.requireSigner();\n const priv = SDKPrivateKey.generateECDSA();\n const pub = priv.publicKey;\n const tx = buildHcs15BaseAccountCreateTx({\n publicKey: pub,\n initialBalance: new Hbar(options?.initialBalance ?? 10),\n maxAutomaticTokenAssociations: options?.maxAutomaticTokenAssociations,\n accountMemo: options?.accountMemo,\n transactionMemo: options?.transactionMemo,\n });\n const frozen = await tx.freezeWithSigner(signer);\n const res: TransactionResponse = await frozen.executeWithSigner(signer);\n const receipt = await res.getReceiptWithSigner(signer as any);\n const accountId = receipt?.accountId?.toString?.();\n const evmAddress = `0x${pub.toEvmAddress()}`;\n this.logger.info('Created HCS-15 base account (browser)', {\n accountId,\n evmAddress,\n });\n return {\n accountId,\n privateKey: priv,\n privateKeyHex: priv.toStringRaw(),\n publicKey: pub,\n evmAddress,\n };\n }\n\n /**\n * Create a petal account reusing a base ECDSA key, via wallet signer.\n */\n async createPetalAccount(params: {\n basePrivateKey: string | PrivateKey;\n initialBalance?: number;\n maxAutomaticTokenAssociations?: number;\n accountMemo?: string;\n transactionMemo?: string;\n }): Promise<{ accountId?: string }> {\n const signer = this.requireSigner();\n const baseKey =\n typeof params.basePrivateKey === 'string'\n ? SDKPrivateKey.fromStringECDSA(params.basePrivateKey)\n : params.basePrivateKey;\n const tx = buildHcs15PetalAccountCreateTx({\n publicKey: baseKey.publicKey,\n initialBalance: new Hbar(params.initialBalance ?? 1),\n maxAutomaticTokenAssociations: params.maxAutomaticTokenAssociations,\n accountMemo: params.accountMemo,\n transactionMemo: params.transactionMemo,\n });\n const frozen = await tx.freezeWithSigner(signer);\n const res: TransactionResponse = await frozen.executeWithSigner(signer);\n const receipt = await res.getReceiptWithSigner(signer as any);\n const accountId = receipt?.accountId?.toString?.();\n this.logger.info('Created HCS-15 petal account (browser)', { accountId });\n return { accountId };\n }\n}\n"],"names":["SDKPrivateKey"],"mappings":";;;AAeO,MAAM,2BAA2B,gBAAgB;AAAA,EAGtD,YAAY,QAAkC;AAC5C,UAAM,MAAM;AACZ,SAAK,SAAS,OAAO,UAAU,OAAO,KAAK,eAAe,UAAU,CAAC;AAAA,EACvE;AAAA,EAEQ,gBAA4B;AAClC,QAAI,CAAC,KAAK,QAAQ;AAChB,YAAM,IAAI,MAAM,qDAAqD;AAAA,IACvE;AACA,WAAO,KAAK;AAAA,EACd;AAAA;AAAA;AAAA;AAAA,EAKA,MAAM,kBAAkB,SAWrB;AACD,UAAM,SAAS,KAAK,cAAA;AACpB,UAAM,OAAOA,WAAc,cAAA;AAC3B,UAAM,MAAM,KAAK;AACjB,UAAM,KAAK,8BAA8B;AAAA,MACvC,WAAW;AAAA,MACX,gBAAgB,IAAI,KAAK,SAAS,kBAAkB,EAAE;AAAA,MACtD,+BAA+B,SAAS;AAAA,MACxC,aAAa,SAAS;AAAA,MACtB,iBAAiB,SAAS;AAAA,IAAA,CAC3B;AACD,UAAM,SAAS,MAAM,GAAG,iBAAiB,MAAM;AAC/C,UAAM,MAA2B,MAAM,OAAO,kBAAkB,MAAM;AACtE,UAAM,UAAU,MAAM,IAAI,qBAAqB,MAAa;AAC5D,UAAM,YAAY,SAAS,WAAW,WAAA;AACtC,UAAM,aAAa,KAAK,IAAI,aAAA,CAAc;AAC1C,SAAK,OAAO,KAAK,yCAAyC;AAAA,MACxD;AAAA,MACA;AAAA,IAAA,CACD;AACD,WAAO;AAAA,MACL;AAAA,MACA,YAAY;AAAA,MACZ,eAAe,KAAK,YAAA;AAAA,MACpB,WAAW;AAAA,MACX;AAAA,IAAA;AAAA,EAEJ;AAAA;AAAA;AAAA;AAAA,EAKA,MAAM,mBAAmB,QAMW;AAClC,UAAM,SAAS,KAAK,cAAA;AACpB,UAAM,UACJ,OAAO,OAAO,mBAAmB,WAC7BA,WAAc,gBAAgB,OAAO,cAAc,IACnD,OAAO;AACb,UAAM,KAAK,+BAA+B;AAAA,MACxC,WAAW,QAAQ;AAAA,MACnB,gBAAgB,IAAI,KAAK,OAAO,kBAAkB,CAAC;AAAA,MACnD,+BAA+B,OAAO;AAAA,MACtC,aAAa,OAAO;AAAA,MACpB,iBAAiB,OAAO;AAAA,IAAA,CACzB;AACD,UAAM,SAAS,MAAM,GAAG,iBAAiB,MAAM;AAC/C,UAAM,MAA2B,MAAM,OAAO,kBAAkB,MAAM;AACtE,UAAM,UAAU,MAAM,IAAI,qBAAqB,MAAa;AAC5D,UAAM,YAAY,SAAS,WAAW,WAAA;AACtC,SAAK,OAAO,KAAK,0CAA0C,EAAE,WAAW;AACxE,WAAO,EAAE,UAAA;AAAA,EACX;AACF;"}
|
|
@@ -1,9 +1,41 @@
|
|
|
1
1
|
import { AccountId, TopicCreateTransaction, CustomFixedFee, TokenId, AccountCreateTransaction, Hbar, AccountUpdateTransaction, ScheduleCreateTransaction, TopicUpdateTransaction } from "@hashgraph/sdk";
|
|
2
2
|
import { buildTopicCreateTx, buildMessageTx } from "./standards-sdk.es146.js";
|
|
3
|
-
import { FloraOperation } from "./standards-sdk.es91.js";
|
|
3
|
+
import { FloraOperation, FloraTopicType } from "./standards-sdk.es91.js";
|
|
4
|
+
const HCS16_FLORA_ACCOUNT_CREATE_TRANSACTION_MEMO = "hcs-16:op:flora_account_create";
|
|
5
|
+
const HCS17_STATE_HASH_TRANSACTION_MEMO = "hcs-17:op:6:2";
|
|
6
|
+
const HCS16_ACCOUNT_KEY_UPDATE_TRANSACTION_MEMO = "hcs-16:op:account_key_update";
|
|
7
|
+
const HCS16_TOPIC_KEY_UPDATE_TRANSACTION_MEMO = "hcs-16:op:topic_key_update";
|
|
8
|
+
function normalizeTransactionMemo(value, fallback) {
|
|
9
|
+
if (typeof value !== "string") return fallback;
|
|
10
|
+
const trimmed = value.trim();
|
|
11
|
+
if (!trimmed) return fallback;
|
|
12
|
+
return trimmed;
|
|
13
|
+
}
|
|
4
14
|
function encodeHcs16FloraMemo(params) {
|
|
5
15
|
return `hcs-16:${params.floraAccountId}:${params.topicType}`;
|
|
6
16
|
}
|
|
17
|
+
function encodeHcs16TopicCreateTransactionMemo(topicType) {
|
|
18
|
+
return `hcs-16:op:topic_create:${topicType}`;
|
|
19
|
+
}
|
|
20
|
+
const HCS16_OPERATION_ENUM_BY_OP = {
|
|
21
|
+
[FloraOperation.FLORA_CREATED]: 0,
|
|
22
|
+
[FloraOperation.TRANSACTION]: 1,
|
|
23
|
+
[FloraOperation.STATE_UPDATE]: 2,
|
|
24
|
+
[FloraOperation.FLORA_JOIN_REQUEST]: 3,
|
|
25
|
+
[FloraOperation.FLORA_JOIN_VOTE]: 4,
|
|
26
|
+
[FloraOperation.FLORA_JOIN_ACCEPTED]: 5
|
|
27
|
+
};
|
|
28
|
+
const HCS16_TOPIC_TYPE_BY_OP = {
|
|
29
|
+
[FloraOperation.FLORA_CREATED]: FloraTopicType.COMMUNICATION,
|
|
30
|
+
[FloraOperation.TRANSACTION]: FloraTopicType.TRANSACTION,
|
|
31
|
+
[FloraOperation.STATE_UPDATE]: FloraTopicType.STATE,
|
|
32
|
+
[FloraOperation.FLORA_JOIN_REQUEST]: FloraTopicType.COMMUNICATION,
|
|
33
|
+
[FloraOperation.FLORA_JOIN_VOTE]: FloraTopicType.COMMUNICATION,
|
|
34
|
+
[FloraOperation.FLORA_JOIN_ACCEPTED]: FloraTopicType.STATE
|
|
35
|
+
};
|
|
36
|
+
function encodeHcs16MessageSubmitTransactionMemo(op) {
|
|
37
|
+
return `hcs-16:op:${HCS16_OPERATION_ENUM_BY_OP[op]}:${HCS16_TOPIC_TYPE_BY_OP[op]}`;
|
|
38
|
+
}
|
|
7
39
|
function buildHcs16CreateFloraTopicTx(params) {
|
|
8
40
|
const memo = encodeHcs16FloraMemo({
|
|
9
41
|
floraAccountId: params.floraAccountId,
|
|
@@ -15,6 +47,12 @@ function buildHcs16CreateFloraTopicTx(params) {
|
|
|
15
47
|
submitKey: params.submitKey,
|
|
16
48
|
operatorPublicKey: params.operatorPublicKey
|
|
17
49
|
});
|
|
50
|
+
tx.setTransactionMemo(
|
|
51
|
+
normalizeTransactionMemo(
|
|
52
|
+
params.transactionMemo,
|
|
53
|
+
encodeHcs16TopicCreateTransactionMemo(params.topicType)
|
|
54
|
+
)
|
|
55
|
+
);
|
|
18
56
|
if (params.autoRenewAccountId) {
|
|
19
57
|
tx.setAutoRenewAccountId(AccountId.fromString(params.autoRenewAccountId));
|
|
20
58
|
}
|
|
@@ -54,13 +92,22 @@ function buildHcs16CreateAccountTx(params) {
|
|
|
54
92
|
tx.setInitialBalance(new Hbar(initial));
|
|
55
93
|
const maxAssoc = typeof params.maxAutomaticTokenAssociations === "number" ? params.maxAutomaticTokenAssociations : -1;
|
|
56
94
|
tx.setMaxAutomaticTokenAssociations(maxAssoc);
|
|
95
|
+
tx.setTransactionMemo(
|
|
96
|
+
normalizeTransactionMemo(
|
|
97
|
+
params.transactionMemo,
|
|
98
|
+
HCS16_FLORA_ACCOUNT_CREATE_TRANSACTION_MEMO
|
|
99
|
+
)
|
|
100
|
+
);
|
|
57
101
|
return tx;
|
|
58
102
|
}
|
|
59
103
|
function buildHcs16ScheduleAccountKeyUpdateTx(params) {
|
|
60
104
|
const inner = new AccountUpdateTransaction().setAccountId(AccountId.fromString(params.floraAccountId)).setKey(params.newKeyList);
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
105
|
+
inner.setTransactionMemo(
|
|
106
|
+
normalizeTransactionMemo(
|
|
107
|
+
params.transactionMemo ?? params.memo,
|
|
108
|
+
HCS16_ACCOUNT_KEY_UPDATE_TRANSACTION_MEMO
|
|
109
|
+
)
|
|
110
|
+
);
|
|
64
111
|
return new ScheduleCreateTransaction().setScheduledTransaction(inner);
|
|
65
112
|
}
|
|
66
113
|
function buildHcs16ScheduleTopicKeyUpdateTx(params) {
|
|
@@ -71,9 +118,12 @@ function buildHcs16ScheduleTopicKeyUpdateTx(params) {
|
|
|
71
118
|
if (params.submitKey) {
|
|
72
119
|
inner.setSubmitKey(params.submitKey);
|
|
73
120
|
}
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
121
|
+
inner.setTransactionMemo(
|
|
122
|
+
normalizeTransactionMemo(
|
|
123
|
+
params.transactionMemo ?? params.memo,
|
|
124
|
+
HCS16_TOPIC_KEY_UPDATE_TRANSACTION_MEMO
|
|
125
|
+
)
|
|
126
|
+
);
|
|
77
127
|
return new ScheduleCreateTransaction().setScheduledTransaction(inner);
|
|
78
128
|
}
|
|
79
129
|
function buildHcs16MessageTx(params) {
|
|
@@ -85,7 +135,11 @@ function buildHcs16MessageTx(params) {
|
|
|
85
135
|
};
|
|
86
136
|
return buildMessageTx({
|
|
87
137
|
topicId: params.topicId,
|
|
88
|
-
message: JSON.stringify(payload)
|
|
138
|
+
message: JSON.stringify(payload),
|
|
139
|
+
transactionMemo: normalizeTransactionMemo(
|
|
140
|
+
params.transactionMemo,
|
|
141
|
+
encodeHcs16MessageSubmitTransactionMemo(params.op)
|
|
142
|
+
)
|
|
89
143
|
});
|
|
90
144
|
}
|
|
91
145
|
function buildHcs16FloraCreatedTx(params) {
|
|
@@ -125,7 +179,10 @@ function buildHcs16StateUpdateTx(params) {
|
|
|
125
179
|
return buildMessageTx({
|
|
126
180
|
topicId: params.topicId,
|
|
127
181
|
message: JSON.stringify(payload),
|
|
128
|
-
transactionMemo:
|
|
182
|
+
transactionMemo: normalizeTransactionMemo(
|
|
183
|
+
params.transactionMemo,
|
|
184
|
+
HCS17_STATE_HASH_TRANSACTION_MEMO
|
|
185
|
+
)
|
|
129
186
|
});
|
|
130
187
|
}
|
|
131
188
|
function buildHcs16FloraJoinRequestTx(params) {
|
|
@@ -166,6 +223,10 @@ function buildHcs16FloraJoinAcceptedTx(params) {
|
|
|
166
223
|
});
|
|
167
224
|
}
|
|
168
225
|
export {
|
|
226
|
+
HCS16_ACCOUNT_KEY_UPDATE_TRANSACTION_MEMO,
|
|
227
|
+
HCS16_FLORA_ACCOUNT_CREATE_TRANSACTION_MEMO,
|
|
228
|
+
HCS16_TOPIC_KEY_UPDATE_TRANSACTION_MEMO,
|
|
229
|
+
HCS17_STATE_HASH_TRANSACTION_MEMO,
|
|
169
230
|
buildHcs16CreateAccountTx,
|
|
170
231
|
buildHcs16CreateFloraTopicTx,
|
|
171
232
|
buildHcs16CreateTransactionTopicTx,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"standards-sdk.es92.js","sources":["../../src/hcs-16/tx.ts"],"sourcesContent":["import {\n TopicCreateTransaction,\n TopicMessageSubmitTransaction,\n TopicUpdateTransaction,\n AccountCreateTransaction,\n AccountUpdateTransaction,\n ScheduleCreateTransaction,\n Hbar,\n PublicKey,\n KeyList,\n AccountId,\n CustomFixedFee,\n TokenId,\n} from '@hashgraph/sdk';\nimport {\n buildTopicCreateTx,\n buildMessageTx,\n type MaybeKey,\n} from '../common/tx/tx-utils';\nimport { FloraOperation, FloraTopicType, type FloraMessage } from './types';\n\nfunction encodeHcs16FloraMemo(params: {\n floraAccountId: string;\n topicType: FloraTopicType;\n}): string {\n return `hcs-16:${params.floraAccountId}:${params.topicType}`;\n}\n\n/**\n * Build a TopicCreateTransaction for HCS‑16 Flora topics (communication/transaction/state).\n */\nexport function buildHcs16CreateFloraTopicTx(params: {\n floraAccountId: string;\n topicType: FloraTopicType;\n adminKey?: MaybeKey;\n submitKey?: MaybeKey;\n operatorPublicKey?: PublicKey;\n autoRenewAccountId?: string;\n}): TopicCreateTransaction {\n const memo = encodeHcs16FloraMemo({\n floraAccountId: params.floraAccountId,\n topicType: params.topicType,\n });\n const tx = buildTopicCreateTx({\n memo,\n adminKey: params.adminKey,\n submitKey: params.submitKey,\n operatorPublicKey: params.operatorPublicKey,\n });\n if (params.autoRenewAccountId) {\n tx.setAutoRenewAccountId(AccountId.fromString(params.autoRenewAccountId));\n }\n return tx;\n}\n\n/**\n * Build a TopicCreateTransaction for a generic HCS‑16 transaction topic with HIP‑991 fees.\n */\nexport function buildHcs16CreateTransactionTopicTx(params: {\n memo: string;\n adminKey?: KeyList | PublicKey;\n submitKey?: KeyList | PublicKey;\n feeScheduleKey?: KeyList | PublicKey;\n customFees?: Array<{\n amount: number;\n feeCollectorAccountId: string;\n denominatingTokenId?: string;\n }>;\n feeExemptKeys?: PublicKey[];\n}): TopicCreateTransaction {\n const tx = new TopicCreateTransaction().setTopicMemo(params.memo);\n if (params.adminKey) {\n tx.setAdminKey(params.adminKey);\n }\n if (params.submitKey) {\n tx.setSubmitKey(params.submitKey);\n }\n if (params.feeScheduleKey) {\n tx.setFeeScheduleKey(params.feeScheduleKey);\n }\n if (params.customFees && params.customFees.length > 0) {\n const fees = params.customFees.map(fee => {\n const cf = new CustomFixedFee()\n .setAmount(fee.amount)\n .setFeeCollectorAccountId(\n AccountId.fromString(fee.feeCollectorAccountId),\n );\n if (fee.denominatingTokenId) {\n cf.setDenominatingTokenId(TokenId.fromString(fee.denominatingTokenId));\n }\n return cf;\n });\n tx.setCustomFees(fees);\n }\n if (params.feeExemptKeys && params.feeExemptKeys.length > 0) {\n throw new Error('feeExemptKeys not supported by installed @hashgraph/sdk');\n }\n return tx;\n}\n\n/**\n * Build an AccountCreateTransaction for a Flora account given a KeyList and optional params.\n */\nexport function buildHcs16CreateAccountTx(params: {\n keyList: KeyList;\n initialBalanceHbar?: number;\n maxAutomaticTokenAssociations?: number;\n}): AccountCreateTransaction {\n const tx = new AccountCreateTransaction().setKey(params.keyList);\n const initial =\n typeof params.initialBalanceHbar === 'number'\n ? params.initialBalanceHbar\n : 1;\n tx.setInitialBalance(new Hbar(initial));\n const maxAssoc =\n typeof params.maxAutomaticTokenAssociations === 'number'\n ? params.maxAutomaticTokenAssociations\n : -1;\n tx.setMaxAutomaticTokenAssociations(maxAssoc);\n return tx;\n}\n\n/**\n * Build a ScheduleCreateTransaction that wraps an AccountUpdateTransaction to rotate the Flora account KeyList.\n * Members will sign this scheduled transaction until threshold is reached and it executes.\n */\nexport function buildHcs16ScheduleAccountKeyUpdateTx(params: {\n floraAccountId: string;\n newKeyList: KeyList;\n memo?: string;\n}): ScheduleCreateTransaction {\n const inner = new AccountUpdateTransaction()\n .setAccountId(AccountId.fromString(params.floraAccountId))\n .setKey(params.newKeyList);\n if (params.memo) {\n inner.setTransactionMemo(params.memo);\n }\n return new ScheduleCreateTransaction().setScheduledTransaction(inner);\n}\n\n/**\n * Build a ScheduleCreateTransaction that wraps a TopicUpdateTransaction to rotate topic admin/submit keys.\n * Repeat for CTopic, TTopic, and STopic as needed for membership changes.\n */\nexport function buildHcs16ScheduleTopicKeyUpdateTx(params: {\n topicId: string;\n adminKey?: KeyList | PublicKey;\n submitKey?: KeyList | PublicKey;\n memo?: string;\n}): ScheduleCreateTransaction {\n const inner = new TopicUpdateTransaction().setTopicId(params.topicId);\n if (params.adminKey) {\n inner.setAdminKey(params.adminKey);\n }\n if (params.submitKey) {\n inner.setSubmitKey(params.submitKey);\n }\n if (params.memo) {\n inner.setTransactionMemo(params.memo);\n }\n return new ScheduleCreateTransaction().setScheduledTransaction(inner);\n}\n\n/**\n * Build a TopicMessageSubmitTransaction for generic HCS‑16 messages.\n * Body fields are merged into the envelope `{ p: 'hcs-16', op, operator_id }`.\n */\nexport function buildHcs16MessageTx(params: {\n topicId: string;\n operatorId: string;\n op: FloraOperation;\n body?: Record<string, unknown>;\n}): TopicMessageSubmitTransaction {\n const payload: FloraMessage = {\n p: 'hcs-16',\n op: params.op,\n operator_id: params.operatorId,\n ...(params.body || {}),\n } as FloraMessage;\n\n return buildMessageTx({\n topicId: params.topicId,\n message: JSON.stringify(payload),\n });\n}\n\n/**\n * Build HCS‑16 flora_created message.\n */\nexport function buildHcs16FloraCreatedTx(params: {\n topicId: string;\n operatorId: string;\n floraAccountId: string;\n topics: { communication: string; transaction: string; state: string };\n}): TopicMessageSubmitTransaction {\n return buildHcs16MessageTx({\n topicId: params.topicId,\n operatorId: params.operatorId,\n op: FloraOperation.FLORA_CREATED,\n body: {\n flora_account_id: params.floraAccountId,\n topics: params.topics,\n },\n });\n}\n\n/**\n * Build HCS‑16 transaction message.\n */\nexport function buildHcs16TransactionTx(params: {\n topicId: string;\n operatorId: string;\n scheduleId: string;\n data?: string;\n}): TopicMessageSubmitTransaction {\n return buildHcs16MessageTx({\n topicId: params.topicId,\n operatorId: params.operatorId,\n op: FloraOperation.TRANSACTION,\n body: {\n schedule_id: params.scheduleId,\n data: params.data,\n m: params.data,\n },\n });\n}\n\n/**\n * Build HCS‑17 state_hash message for Flora STopic state updates.\n */\nexport function buildHcs16StateUpdateTx(params: {\n topicId: string;\n operatorId: string;\n hash: string;\n epoch?: number;\n accountId?: string;\n topics?: string[];\n memo?: string;\n transactionMemo?: string;\n}): TopicMessageSubmitTransaction {\n const payload = {\n p: 'hcs-17',\n op: 'state_hash',\n state_hash: params.hash,\n topics: params.topics ?? [],\n account_id: params.accountId ?? params.operatorId,\n epoch: params.epoch,\n timestamp: new Date().toISOString(),\n m: params.memo,\n };\n return buildMessageTx({\n topicId: params.topicId,\n message: JSON.stringify(payload),\n transactionMemo: params.transactionMemo,\n });\n}\n\n/**\n * Build HCS‑16 flora_join_request message.\n */\nexport function buildHcs16FloraJoinRequestTx(params: {\n topicId: string;\n operatorId: string;\n accountId: string;\n connectionRequestId: number;\n connectionTopicId: string;\n connectionSeq: number;\n}): TopicMessageSubmitTransaction {\n return buildHcs16MessageTx({\n topicId: params.topicId,\n operatorId: params.operatorId,\n op: FloraOperation.FLORA_JOIN_REQUEST,\n body: {\n account_id: params.accountId,\n connection_request_id: params.connectionRequestId,\n connection_topic_id: params.connectionTopicId,\n connection_seq: params.connectionSeq,\n },\n });\n}\n\n/**\n * Build HCS‑16 flora_join_vote message.\n */\nexport function buildHcs16FloraJoinVoteTx(params: {\n topicId: string;\n operatorId: string;\n accountId: string;\n approve: boolean;\n connectionRequestId: number;\n connectionSeq: number;\n}): TopicMessageSubmitTransaction {\n return buildHcs16MessageTx({\n topicId: params.topicId,\n operatorId: params.operatorId,\n op: FloraOperation.FLORA_JOIN_VOTE,\n body: {\n account_id: params.accountId,\n approve: params.approve,\n connection_request_id: params.connectionRequestId,\n connection_seq: params.connectionSeq,\n },\n });\n}\n\n/**\n * Build HCS‑16 flora_join_accepted message.\n */\nexport function buildHcs16FloraJoinAcceptedTx(params: {\n topicId: string;\n operatorId: string;\n members: string[];\n epoch?: number;\n}): TopicMessageSubmitTransaction {\n return buildHcs16MessageTx({\n topicId: params.topicId,\n operatorId: params.operatorId,\n op: FloraOperation.FLORA_JOIN_ACCEPTED,\n body: {\n members: params.members,\n epoch: params.epoch,\n },\n });\n}\n"],"names":[],"mappings":";;;AAqBA,SAAS,qBAAqB,QAGnB;AACT,SAAO,UAAU,OAAO,cAAc,IAAI,OAAO,SAAS;AAC5D;AAKO,SAAS,6BAA6B,QAOlB;AACzB,QAAM,OAAO,qBAAqB;AAAA,IAChC,gBAAgB,OAAO;AAAA,IACvB,WAAW,OAAO;AAAA,EAAA,CACnB;AACD,QAAM,KAAK,mBAAmB;AAAA,IAC5B;AAAA,IACA,UAAU,OAAO;AAAA,IACjB,WAAW,OAAO;AAAA,IAClB,mBAAmB,OAAO;AAAA,EAAA,CAC3B;AACD,MAAI,OAAO,oBAAoB;AAC7B,OAAG,sBAAsB,UAAU,WAAW,OAAO,kBAAkB,CAAC;AAAA,EAC1E;AACA,SAAO;AACT;AAKO,SAAS,mCAAmC,QAWxB;AACzB,QAAM,KAAK,IAAI,uBAAA,EAAyB,aAAa,OAAO,IAAI;AAChE,MAAI,OAAO,UAAU;AACnB,OAAG,YAAY,OAAO,QAAQ;AAAA,EAChC;AACA,MAAI,OAAO,WAAW;AACpB,OAAG,aAAa,OAAO,SAAS;AAAA,EAClC;AACA,MAAI,OAAO,gBAAgB;AACzB,OAAG,kBAAkB,OAAO,cAAc;AAAA,EAC5C;AACA,MAAI,OAAO,cAAc,OAAO,WAAW,SAAS,GAAG;AACrD,UAAM,O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IACzB,SAAS,OAAO;AAAA,IAChB,YAAY,OAAO;AAAA,IACnB,IAAI,eAAe;AAAA,IACnB,MAAM;AAAA,MACJ,YAAY,OAAO;AAAA,MACnB,uBAAuB,OAAO;AAAA,MAC9B,qBAAqB,OAAO;AAAA,MAC5B,gBAAgB,OAAO;AAAA,IAAA;AAAA,EACzB,CACD;AACH;AAKO,SAAS,0BAA0B,QAOR;AAChC,SAAO,oBAAoB;AAAA,IACzB,SAAS,OAAO;AAAA,IAChB,YAAY,OAAO;AAAA,IACnB,IAAI,eAAe;AAAA,IACnB,MAAM;AAAA,MACJ,YAAY,OAAO;AAAA,MACnB,SAAS,OAAO;AAAA,MAChB,uBAAuB,OAAO;AAAA,MAC9B,gBAAgB,OAAO;AAAA,IAAA;AAAA,EACzB,CACD;AACH;AAKO,SAAS,8BAA8B,QAKZ;AAChC,SAAO,oBAAoB;AAAA,IACzB,SAAS,OAAO;AAAA,IAChB,YAAY,OAAO;AAAA,IACnB,IAAI,eAAe;AAAA,IACnB,MAAM;AAAA,MACJ,SAAS,OAAO;AAAA,MAChB,OAAO,OAAO;AAAA,IAAA;AAAA,EAChB,CACD;AACH;"}
|
|
1
|
+
{"version":3,"file":"standards-sdk.es92.js","sources":["../../src/hcs-16/tx.ts"],"sourcesContent":["import {\n TopicCreateTransaction,\n TopicMessageSubmitTransaction,\n TopicUpdateTransaction,\n AccountCreateTransaction,\n AccountUpdateTransaction,\n ScheduleCreateTransaction,\n Hbar,\n PublicKey,\n KeyList,\n AccountId,\n CustomFixedFee,\n TokenId,\n} from '@hashgraph/sdk';\nimport {\n buildTopicCreateTx,\n buildMessageTx,\n type MaybeKey,\n} from '../common/tx/tx-utils';\nimport { FloraOperation, FloraTopicType, type FloraMessage } from './types';\n\nexport const HCS16_FLORA_ACCOUNT_CREATE_TRANSACTION_MEMO =\n 'hcs-16:op:flora_account_create';\nexport const HCS17_STATE_HASH_TRANSACTION_MEMO = 'hcs-17:op:6:2';\nexport const HCS16_ACCOUNT_KEY_UPDATE_TRANSACTION_MEMO =\n 'hcs-16:op:account_key_update';\nexport const HCS16_TOPIC_KEY_UPDATE_TRANSACTION_MEMO =\n 'hcs-16:op:topic_key_update';\n\nfunction normalizeTransactionMemo(\n value: string | undefined,\n fallback: string,\n): string {\n if (typeof value !== 'string') return fallback;\n const trimmed = value.trim();\n if (!trimmed) return fallback;\n return trimmed;\n}\n\nfunction encodeHcs16FloraMemo(params: {\n floraAccountId: string;\n topicType: FloraTopicType;\n}): string {\n return `hcs-16:${params.floraAccountId}:${params.topicType}`;\n}\n\nfunction encodeHcs16TopicCreateTransactionMemo(\n topicType: FloraTopicType,\n): string {\n return `hcs-16:op:topic_create:${topicType}`;\n}\n\nconst HCS16_OPERATION_ENUM_BY_OP: Record<FloraOperation, number> = {\n [FloraOperation.FLORA_CREATED]: 0,\n [FloraOperation.TRANSACTION]: 1,\n [FloraOperation.STATE_UPDATE]: 2,\n [FloraOperation.FLORA_JOIN_REQUEST]: 3,\n [FloraOperation.FLORA_JOIN_VOTE]: 4,\n [FloraOperation.FLORA_JOIN_ACCEPTED]: 5,\n};\n\nconst HCS16_TOPIC_TYPE_BY_OP: Record<FloraOperation, FloraTopicType> = {\n [FloraOperation.FLORA_CREATED]: FloraTopicType.COMMUNICATION,\n [FloraOperation.TRANSACTION]: FloraTopicType.TRANSACTION,\n [FloraOperation.STATE_UPDATE]: FloraTopicType.STATE,\n [FloraOperation.FLORA_JOIN_REQUEST]: FloraTopicType.COMMUNICATION,\n [FloraOperation.FLORA_JOIN_VOTE]: FloraTopicType.COMMUNICATION,\n [FloraOperation.FLORA_JOIN_ACCEPTED]: FloraTopicType.STATE,\n};\n\nfunction encodeHcs16MessageSubmitTransactionMemo(op: FloraOperation): string {\n return `hcs-16:op:${HCS16_OPERATION_ENUM_BY_OP[op]}:${HCS16_TOPIC_TYPE_BY_OP[op]}`;\n}\n\n/**\n * Build a TopicCreateTransaction for HCS‑16 Flora topics (communication/transaction/state).\n */\nexport function buildHcs16CreateFloraTopicTx(params: {\n floraAccountId: string;\n topicType: FloraTopicType;\n adminKey?: MaybeKey;\n submitKey?: MaybeKey;\n operatorPublicKey?: PublicKey;\n autoRenewAccountId?: string;\n transactionMemo?: string;\n}): TopicCreateTransaction {\n const memo = encodeHcs16FloraMemo({\n floraAccountId: params.floraAccountId,\n topicType: params.topicType,\n });\n const tx = buildTopicCreateTx({\n memo,\n adminKey: params.adminKey,\n submitKey: params.submitKey,\n operatorPublicKey: params.operatorPublicKey,\n });\n tx.setTransactionMemo(\n normalizeTransactionMemo(\n params.transactionMemo,\n encodeHcs16TopicCreateTransactionMemo(params.topicType),\n ),\n );\n if (params.autoRenewAccountId) {\n tx.setAutoRenewAccountId(AccountId.fromString(params.autoRenewAccountId));\n }\n return tx;\n}\n\n/**\n * Build a TopicCreateTransaction for a generic HCS‑16 transaction topic with HIP‑991 fees.\n */\nexport function buildHcs16CreateTransactionTopicTx(params: {\n memo: string;\n adminKey?: KeyList | PublicKey;\n submitKey?: KeyList | PublicKey;\n feeScheduleKey?: KeyList | PublicKey;\n customFees?: Array<{\n amount: number;\n feeCollectorAccountId: string;\n denominatingTokenId?: string;\n }>;\n feeExemptKeys?: PublicKey[];\n}): TopicCreateTransaction {\n const tx = new TopicCreateTransaction().setTopicMemo(params.memo);\n if (params.adminKey) {\n tx.setAdminKey(params.adminKey);\n }\n if (params.submitKey) {\n tx.setSubmitKey(params.submitKey);\n }\n if (params.feeScheduleKey) {\n tx.setFeeScheduleKey(params.feeScheduleKey);\n }\n if (params.customFees && params.customFees.length > 0) {\n const fees = params.customFees.map(fee => {\n const cf = new CustomFixedFee()\n .setAmount(fee.amount)\n .setFeeCollectorAccountId(\n AccountId.fromString(fee.feeCollectorAccountId),\n );\n if (fee.denominatingTokenId) {\n cf.setDenominatingTokenId(TokenId.fromString(fee.denominatingTokenId));\n }\n return cf;\n });\n tx.setCustomFees(fees);\n }\n if (params.feeExemptKeys && params.feeExemptKeys.length > 0) {\n throw new Error('feeExemptKeys not supported by installed @hashgraph/sdk');\n }\n return tx;\n}\n\n/**\n * Build an AccountCreateTransaction for a Flora account given a KeyList and optional params.\n */\nexport function buildHcs16CreateAccountTx(params: {\n keyList: KeyList;\n initialBalanceHbar?: number;\n maxAutomaticTokenAssociations?: number;\n transactionMemo?: string;\n}): AccountCreateTransaction {\n const tx = new AccountCreateTransaction().setKey(params.keyList);\n const initial =\n typeof params.initialBalanceHbar === 'number'\n ? params.initialBalanceHbar\n : 1;\n tx.setInitialBalance(new Hbar(initial));\n const maxAssoc =\n typeof params.maxAutomaticTokenAssociations === 'number'\n ? params.maxAutomaticTokenAssociations\n : -1;\n tx.setMaxAutomaticTokenAssociations(maxAssoc);\n tx.setTransactionMemo(\n normalizeTransactionMemo(\n params.transactionMemo,\n HCS16_FLORA_ACCOUNT_CREATE_TRANSACTION_MEMO,\n ),\n );\n return tx;\n}\n\n/**\n * Build a ScheduleCreateTransaction that wraps an AccountUpdateTransaction to rotate the Flora account KeyList.\n * Members will sign this scheduled transaction until threshold is reached and it executes.\n */\nexport function buildHcs16ScheduleAccountKeyUpdateTx(params: {\n floraAccountId: string;\n newKeyList: KeyList;\n memo?: string;\n transactionMemo?: string;\n}): ScheduleCreateTransaction {\n const inner = new AccountUpdateTransaction()\n .setAccountId(AccountId.fromString(params.floraAccountId))\n .setKey(params.newKeyList);\n inner.setTransactionMemo(\n normalizeTransactionMemo(\n params.transactionMemo ?? params.memo,\n HCS16_ACCOUNT_KEY_UPDATE_TRANSACTION_MEMO,\n ),\n );\n return new ScheduleCreateTransaction().setScheduledTransaction(inner);\n}\n\n/**\n * Build a ScheduleCreateTransaction that wraps a TopicUpdateTransaction to rotate topic admin/submit keys.\n * Repeat for CTopic, TTopic, and STopic as needed for membership changes.\n */\nexport function buildHcs16ScheduleTopicKeyUpdateTx(params: {\n topicId: string;\n adminKey?: KeyList | PublicKey;\n submitKey?: KeyList | PublicKey;\n memo?: string;\n transactionMemo?: string;\n}): ScheduleCreateTransaction {\n const inner = new TopicUpdateTransaction().setTopicId(params.topicId);\n if (params.adminKey) {\n inner.setAdminKey(params.adminKey);\n }\n if (params.submitKey) {\n inner.setSubmitKey(params.submitKey);\n }\n inner.setTransactionMemo(\n normalizeTransactionMemo(\n params.transactionMemo ?? params.memo,\n HCS16_TOPIC_KEY_UPDATE_TRANSACTION_MEMO,\n ),\n );\n return new ScheduleCreateTransaction().setScheduledTransaction(inner);\n}\n\n/**\n * Build a TopicMessageSubmitTransaction for generic HCS‑16 messages.\n * Body fields are merged into the envelope `{ p: 'hcs-16', op, operator_id }`.\n */\nexport function buildHcs16MessageTx(params: {\n topicId: string;\n operatorId: string;\n op: FloraOperation;\n body?: Record<string, unknown>;\n transactionMemo?: string;\n}): TopicMessageSubmitTransaction {\n const payload: FloraMessage = {\n p: 'hcs-16',\n op: params.op,\n operator_id: params.operatorId,\n ...(params.body || {}),\n } as FloraMessage;\n\n return buildMessageTx({\n topicId: params.topicId,\n message: JSON.stringify(payload),\n transactionMemo: normalizeTransactionMemo(\n params.transactionMemo,\n encodeHcs16MessageSubmitTransactionMemo(params.op),\n ),\n });\n}\n\n/**\n * Build HCS‑16 flora_created message.\n */\nexport function buildHcs16FloraCreatedTx(params: {\n topicId: string;\n operatorId: string;\n floraAccountId: string;\n topics: { communication: string; transaction: string; state: string };\n}): TopicMessageSubmitTransaction {\n return buildHcs16MessageTx({\n topicId: params.topicId,\n operatorId: params.operatorId,\n op: FloraOperation.FLORA_CREATED,\n body: {\n flora_account_id: params.floraAccountId,\n topics: params.topics,\n },\n });\n}\n\n/**\n * Build HCS‑16 transaction message.\n */\nexport function buildHcs16TransactionTx(params: {\n topicId: string;\n operatorId: string;\n scheduleId: string;\n data?: string;\n}): TopicMessageSubmitTransaction {\n return buildHcs16MessageTx({\n topicId: params.topicId,\n operatorId: params.operatorId,\n op: FloraOperation.TRANSACTION,\n body: {\n schedule_id: params.scheduleId,\n data: params.data,\n m: params.data,\n },\n });\n}\n\n/**\n * Build HCS‑17 state_hash message for Flora STopic state updates.\n */\nexport function buildHcs16StateUpdateTx(params: {\n topicId: string;\n operatorId: string;\n hash: string;\n epoch?: number;\n accountId?: string;\n topics?: string[];\n memo?: string;\n transactionMemo?: string;\n}): TopicMessageSubmitTransaction {\n const payload = {\n p: 'hcs-17',\n op: 'state_hash',\n state_hash: params.hash,\n topics: params.topics ?? [],\n account_id: params.accountId ?? params.operatorId,\n epoch: params.epoch,\n timestamp: new Date().toISOString(),\n m: params.memo,\n };\n return buildMessageTx({\n topicId: params.topicId,\n message: JSON.stringify(payload),\n transactionMemo: normalizeTransactionMemo(\n params.transactionMemo,\n HCS17_STATE_HASH_TRANSACTION_MEMO,\n ),\n });\n}\n\n/**\n * Build HCS‑16 flora_join_request message.\n */\nexport function buildHcs16FloraJoinRequestTx(params: {\n topicId: string;\n operatorId: string;\n accountId: string;\n connectionRequestId: number;\n connectionTopicId: string;\n connectionSeq: number;\n}): TopicMessageSubmitTransaction {\n return buildHcs16MessageTx({\n topicId: params.topicId,\n operatorId: params.operatorId,\n op: FloraOperation.FLORA_JOIN_REQUEST,\n body: {\n account_id: params.accountId,\n connection_request_id: params.connectionRequestId,\n connection_topic_id: params.connectionTopicId,\n connection_seq: params.connectionSeq,\n },\n });\n}\n\n/**\n * Build HCS‑16 flora_join_vote message.\n */\nexport function buildHcs16FloraJoinVoteTx(params: {\n topicId: string;\n operatorId: string;\n accountId: string;\n approve: boolean;\n connectionRequestId: number;\n connectionSeq: number;\n}): TopicMessageSubmitTransaction {\n return buildHcs16MessageTx({\n topicId: params.topicId,\n operatorId: params.operatorId,\n op: FloraOperation.FLORA_JOIN_VOTE,\n body: {\n account_id: params.accountId,\n approve: params.approve,\n connection_request_id: params.connectionRequestId,\n connection_seq: params.connectionSeq,\n },\n });\n}\n\n/**\n * Build HCS‑16 flora_join_accepted message.\n */\nexport function buildHcs16FloraJoinAcceptedTx(params: {\n topicId: string;\n operatorId: string;\n members: string[];\n epoch?: number;\n}): TopicMessageSubmitTransaction {\n return buildHcs16MessageTx({\n topicId: params.topicId,\n operatorId: params.operatorId,\n op: FloraOperation.FLORA_JOIN_ACCEPTED,\n body: {\n members: params.members,\n epoch: params.epoch,\n },\n });\n}\n"],"names":[],"mappings":";;;AAqBO,MAAM,8CACX;AACK,MAAM,oCAAoC;AAC1C,MAAM,4CACX;AACK,MAAM,0CACX;AAEF,SAAS,yBACP,OACA,UACQ;AACR,MAAI,OAAO,UAAU,SAAU,QAAO;AACtC,QAAM,UAAU,MAAM,KAAA;AACtB,MAAI,CAAC,QAAS,QAAO;AACrB,SAAO;AACT;AAEA,SAAS,qBAAqB,QAGnB;AACT,SAAO,UAAU,OAAO,cAAc,IAAI,OAAO,SAAS;AAC5D;AAEA,SAAS,sCACP,WACQ;AACR,SAAO,0BAA0B,SAAS;AAC5C;AAEA,MAAM,6BAA6D;AAAA,EACjE,CAAC,eAAe,aAAa,GAAG;AAAA,EAChC,CAAC,eAAe,WAAW,GAAG;AAAA,EAC9B,CAAC,eAAe,YAAY,GAAG;AAAA,EAC/B,CAAC,eAAe,kBAAkB,GAAG;AAAA,EACrC,CAAC,eAAe,eAAe,GAAG;AAAA,EAClC,CAAC,eAAe,mBAAmB,GAAG;AACxC;AAEA,MAAM,yBAAiE;AAAA,EACrE,CAAC,eAAe,aAAa,GAAG,eAAe;AAAA,EAC/C,CAAC,eAAe,WAAW,GAAG,eAAe;AAAA,EAC7C,CAAC,eAAe,YAAY,GAAG,eAAe;AAAA,EAC9C,CAAC,eAAe,kBAAkB,GAAG,eAAe;AAAA,EACpD,CAAC,eAAe,eAAe,GAAG,eAAe;AAAA,EACjD,CAAC,eAAe,mBAAmB,GAAG,eAAe;AACvD;AAEA,SAAS,wCAAwC,IAA4B;AAC3E,SAAO,aAAa,2BAA2B,EAAE,CAAC,IAAI,uBAAuB,EAAE,CAAC;AAClF;AAKO,SAAS,6BAA6B,QAQlB;AACzB,QAAM,OAAO,qBAAqB;AAAA,IAChC,gBAAgB,OAAO;AAAA,IACvB,WAAW,OAAO;AAAA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ChB,YAAY,OAAO;AAAA,IACnB,IAAI,eAAe;AAAA,IACnB,MAAM;AAAA,MACJ,YAAY,OAAO;AAAA,MACnB,SAAS,OAAO;AAAA,MAChB,uBAAuB,OAAO;AAAA,MAC9B,gBAAgB,OAAO;AAAA,IAAA;AAAA,EACzB,CACD;AACH;AAKO,SAAS,8BAA8B,QAKZ;AAChC,SAAO,oBAAoB;AAAA,IACzB,SAAS,OAAO;AAAA,IAChB,YAAY,OAAO;AAAA,IACnB,IAAI,eAAe;AAAA,IACnB,MAAM;AAAA,MACJ,SAAS,OAAO;AAAA,MAChB,OAAO,OAAO;AAAA,IAAA;AAAA,EAChB,CACD;AACH;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dynamic-import.d.ts","sourceRoot":"","sources":["../../../src/utils/dynamic-import.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"dynamic-import.d.ts","sourceRoot":"","sources":["../../../src/utils/dynamic-import.ts"],"names":[],"mappings":"AAyEA,wBAAsB,cAAc,CAAC,CAAC,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC,CAiB5E;AAED,wBAAgB,kBAAkB,CAAC,CAAC,EAAE,SAAS,EAAE,MAAM,GAAG,CAAC,GAAG,IAAI,CA4BjE"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hashgraphonline/standards-sdk",
|
|
3
|
-
"version": "0.1.143-feat-solana-register.canary.
|
|
3
|
+
"version": "0.1.143-feat-solana-register.canary.4aacd87.68",
|
|
4
4
|
"description": "The Hashgraph Online Standards SDK provides a complete implementation of the Hashgraph Consensus Standards (HCS), giving developers all the tools needed to build applications on Hedera.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|