3 public class InMemorySigner {
5 public internal(set) var cOpaqueStruct: LDKInMemorySigner?;
7 /* DEFAULT_CONSTRUCTOR_START */
8 public init(funding_key: [UInt8], revocation_base_key: [UInt8], payment_key: [UInt8], delayed_payment_base_key: [UInt8], htlc_base_key: [UInt8], commitment_seed: [UInt8], channel_value_satoshis: UInt64, channel_keys_id: [UInt8]) {
10 self.cOpaqueStruct = InMemorySigner_new(Bindings.new_LDKSecretKey(array: funding_key), Bindings.new_LDKSecretKey(array: revocation_base_key), Bindings.new_LDKSecretKey(array: payment_key), Bindings.new_LDKSecretKey(array: delayed_payment_base_key), Bindings.new_LDKSecretKey(array: htlc_base_key), Bindings.new_LDKThirtyTwoBytes(array: commitment_seed), channel_value_satoshis, Bindings.new_LDKThirtyTwoBytes(array: channel_keys_id))
12 /* DEFAULT_CONSTRUCTOR_END */
14 public init(pointer: LDKInMemorySigner){
15 self.cOpaqueStruct = pointer
18 /* STRUCT_METHODS_START */
20 public func get_funding_key() -> [UInt8] {
22 return Bindings.tuple32_to_array(nativeType: withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKInMemorySigner>) in
23 InMemorySigner_get_funding_key(this_ptrPointer)
27 public func set_funding_key(val: [UInt8]) -> Void {
29 let this_ptrPointer = UnsafeMutablePointer<LDKInMemorySigner>.allocate(capacity: 1)
30 this_ptrPointer.initialize(to: self.cOpaqueStruct!)
32 return InMemorySigner_set_funding_key(this_ptrPointer, Bindings.new_LDKSecretKey(array: val));
35 public func get_revocation_base_key() -> [UInt8] {
37 return Bindings.tuple32_to_array(nativeType: withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKInMemorySigner>) in
38 InMemorySigner_get_revocation_base_key(this_ptrPointer)
42 public func set_revocation_base_key(val: [UInt8]) -> Void {
44 let this_ptrPointer = UnsafeMutablePointer<LDKInMemorySigner>.allocate(capacity: 1)
45 this_ptrPointer.initialize(to: self.cOpaqueStruct!)
47 return InMemorySigner_set_revocation_base_key(this_ptrPointer, Bindings.new_LDKSecretKey(array: val));
50 public func get_payment_key() -> [UInt8] {
52 return Bindings.tuple32_to_array(nativeType: withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKInMemorySigner>) in
53 InMemorySigner_get_payment_key(this_ptrPointer)
57 public func set_payment_key(val: [UInt8]) -> Void {
59 let this_ptrPointer = UnsafeMutablePointer<LDKInMemorySigner>.allocate(capacity: 1)
60 this_ptrPointer.initialize(to: self.cOpaqueStruct!)
62 return InMemorySigner_set_payment_key(this_ptrPointer, Bindings.new_LDKSecretKey(array: val));
65 public func get_delayed_payment_base_key() -> [UInt8] {
67 return Bindings.tuple32_to_array(nativeType: withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKInMemorySigner>) in
68 InMemorySigner_get_delayed_payment_base_key(this_ptrPointer)
72 public func set_delayed_payment_base_key(val: [UInt8]) -> Void {
74 let this_ptrPointer = UnsafeMutablePointer<LDKInMemorySigner>.allocate(capacity: 1)
75 this_ptrPointer.initialize(to: self.cOpaqueStruct!)
77 return InMemorySigner_set_delayed_payment_base_key(this_ptrPointer, Bindings.new_LDKSecretKey(array: val));
80 public func get_htlc_base_key() -> [UInt8] {
82 return Bindings.tuple32_to_array(nativeType: withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKInMemorySigner>) in
83 InMemorySigner_get_htlc_base_key(this_ptrPointer)
87 public func set_htlc_base_key(val: [UInt8]) -> Void {
89 let this_ptrPointer = UnsafeMutablePointer<LDKInMemorySigner>.allocate(capacity: 1)
90 this_ptrPointer.initialize(to: self.cOpaqueStruct!)
92 return InMemorySigner_set_htlc_base_key(this_ptrPointer, Bindings.new_LDKSecretKey(array: val));
95 public func get_commitment_seed() -> [UInt8] {
97 return Bindings.tuple32_to_array(nativeType: withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKInMemorySigner>) in
98 InMemorySigner_get_commitment_seed(this_ptrPointer)
102 public func set_commitment_seed(val: [UInt8]) -> Void {
104 let this_ptrPointer = UnsafeMutablePointer<LDKInMemorySigner>.allocate(capacity: 1)
105 this_ptrPointer.initialize(to: self.cOpaqueStruct!)
107 return InMemorySigner_set_commitment_seed(this_ptrPointer, Bindings.new_LDKThirtyTwoBytes(array: val));
110 public func clone(orig: InMemorySigner) -> InMemorySigner {
112 return withUnsafePointer(to: orig.cOpaqueStruct!) { (origPointer: UnsafePointer<LDKInMemorySigner>) in
113 InMemorySigner(pointer: InMemorySigner_clone(origPointer))
117 public func counterparty_pubkeys() -> ChannelPublicKeys {
119 return ChannelPublicKeys(pointer: withUnsafePointer(to: self.cOpaqueStruct!) { (this_argPointer: UnsafePointer<LDKInMemorySigner>) in
120 InMemorySigner_counterparty_pubkeys(this_argPointer)
124 public func counterparty_selected_contest_delay() -> UInt16 {
126 return withUnsafePointer(to: self.cOpaqueStruct!) { (this_argPointer: UnsafePointer<LDKInMemorySigner>) in
127 InMemorySigner_counterparty_selected_contest_delay(this_argPointer)
131 public func holder_selected_contest_delay() -> UInt16 {
133 return withUnsafePointer(to: self.cOpaqueStruct!) { (this_argPointer: UnsafePointer<LDKInMemorySigner>) in
134 InMemorySigner_holder_selected_contest_delay(this_argPointer)
138 public func is_outbound() -> Bool {
140 return withUnsafePointer(to: self.cOpaqueStruct!) { (this_argPointer: UnsafePointer<LDKInMemorySigner>) in
141 InMemorySigner_is_outbound(this_argPointer)
145 public func funding_outpoint() -> OutPoint {
147 return OutPoint(pointer: withUnsafePointer(to: self.cOpaqueStruct!) { (this_argPointer: UnsafePointer<LDKInMemorySigner>) in
148 InMemorySigner_funding_outpoint(this_argPointer)
152 public func get_channel_parameters() -> ChannelTransactionParameters {
154 return ChannelTransactionParameters(pointer: withUnsafePointer(to: self.cOpaqueStruct!) { (this_argPointer: UnsafePointer<LDKInMemorySigner>) in
155 InMemorySigner_get_channel_parameters(this_argPointer)
159 public func sign_counterparty_payment_input(spend_tx: [UInt8], input_idx: UInt, descriptor: StaticPaymentOutputDescriptor) -> Result_CVec_CVec_u8ZZNoneZ {
161 return Result_CVec_CVec_u8ZZNoneZ(pointer: withUnsafePointer(to: self.cOpaqueStruct!) { (this_argPointer: UnsafePointer<LDKInMemorySigner>) in
162 withUnsafePointer(to: descriptor.cOpaqueStruct!) { (descriptorPointer: UnsafePointer<LDKStaticPaymentOutputDescriptor>) in
163 InMemorySigner_sign_counterparty_payment_input(this_argPointer, Bindings.new_LDKTransaction(array: spend_tx), input_idx, descriptorPointer)
168 public func sign_dynamic_p2wsh_input(spend_tx: [UInt8], input_idx: UInt, descriptor: DelayedPaymentOutputDescriptor) -> Result_CVec_CVec_u8ZZNoneZ {
170 return Result_CVec_CVec_u8ZZNoneZ(pointer: withUnsafePointer(to: self.cOpaqueStruct!) { (this_argPointer: UnsafePointer<LDKInMemorySigner>) in
171 withUnsafePointer(to: descriptor.cOpaqueStruct!) { (descriptorPointer: UnsafePointer<LDKDelayedPaymentOutputDescriptor>) in
172 InMemorySigner_sign_dynamic_p2wsh_input(this_argPointer, Bindings.new_LDKTransaction(array: spend_tx), input_idx, descriptorPointer)
177 public func as_BaseSign() -> BaseSign {
179 return NativelyImplementedBaseSign(pointer: withUnsafePointer(to: self.cOpaqueStruct!) { (this_argPointer: UnsafePointer<LDKInMemorySigner>) in
180 InMemorySigner_as_BaseSign(this_argPointer)
184 public func as_Sign() -> Sign {
186 return NativelyImplementedSign(pointer: withUnsafePointer(to: self.cOpaqueStruct!) { (this_argPointer: UnsafePointer<LDKInMemorySigner>) in
187 InMemorySigner_as_Sign(this_argPointer)
191 public func write(obj: InMemorySigner) -> [UInt8] {
193 return Bindings.LDKCVec_u8Z_to_array(nativeType: withUnsafePointer(to: obj.cOpaqueStruct!) { (objPointer: UnsafePointer<LDKInMemorySigner>) in
194 InMemorySigner_write(objPointer)
198 public func read(ser: [UInt8]) -> Result_InMemorySignerDecodeErrorZ {
200 return Result_InMemorySignerDecodeErrorZ(pointer: InMemorySigner_read(Bindings.new_LDKu8slice(array: ser)));
205 if self.cOpaqueStruct?.is_owned == false {
209 InMemorySigner_free(self.cOpaqueStruct!)
215 /* STRUCT_METHODS_END */