return _change(this, representative)
}
+ /**
+ * Specialized block only used for setting account `frontier` when refreshing
+ * from the network. Epoch blocks are created by Nano Foundation developers.
+ *
+ * @returns {Block} This block unchanged
+ */
+ epoch (): Block {
+ return this
+ }
+
/**
* Alias for `receive()`. Zeros out `previous` as required for initial recieve
* blocks.
}
try {
const res = await rpc.post('process', data)
- if (res == null || typeof res !== 'object' || !('hash' in res) || typeof res.hash !== 'string') {
- throw new Error('RPC process request received incomplete response', { cause: res })
- }
return res.hash
- } catch (err) {
- throw new Error('Block could not be processed', { cause: err })
+ } catch (err: any) {
+ throw new Error('Block could not be processed', { cause: err.message })
}
}
block: BlockInfoContents
force: false
json_block: true
- subtype: 'change' | 'epoch' | 'open' | 'receive' | 'send'
+ subtype: 'change' | 'receive' | 'send'
}
export type ProcessResponse = {